GitBook Build 导出html不跳转
文件名须以”_test.go”结尾
方法名须以”Test”打头,并且形参为 (t *testing.T)
举例:/hello_test.go
1 |
|
1 | CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go |
1 | CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go |
1 | SET CGO_ENABLED=0 |
defer
意为延迟,在 golang
中用于延迟执行一个函数。它可以帮助我们处理容易忽略的问题,如资源释放、连接关闭等。但在实际使用过程中,有一些需要注意的地方(坑),下面我们一一道来。
1 | package main |
1 | Error report: |
今天在运行hexo
时又报错了,错误具体信息如下
1 | (node:96650) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated. |