Add an interesting code sample

This commit is contained in:
2020-01-09 14:22:00 +11:00
parent 9b06401cbb
commit 9c6485b167
+19 -2
View File
@@ -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: <https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop>
* gore <https://github.com/motemen/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)