diff --git a/categories/go.md b/categories/go.md index d2dbae0..222179c 100644 --- a/categories/go.md +++ b/categories/go.md @@ -358,9 +358,9 @@ func main() { } ``` -# commands +## commands -## test +### test - go test ./... -  run all tests in current directory and all of its subdirectories @@ -379,6 +379,23 @@ Wiki: * gore +# Some code snippets + +## defer would still run after panic + +```go +package main +func main() { + for { + defer func() { + for { + } + }() + panic("yolo") + } +} +``` + # Useful links * [Go best practice](https://github.com/golang/go/wiki/CodeReviewComments) * [Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments)