2021-01-05から1日間の記事一覧
つけないと lint エラーが検知されても exit status が 0 になり、 CI が pass してしまう。 $ golint -h Usage of golint: golint [flags] # runs on package in current directory golint [flags] [packages] golint [flags] [directories] # where a '/..…
The Go Playground で Test & Example がしやすくなった - Qiita に詳しい。 TestXxx ポイント import "testing" する func main() を書かない func TestXxx() を普通に書く package main import ( "testing" ) func Hello() string { return "Hello" } func…
これもなぜ調べたか忘れてしまったが、 Go の json.Unmarshal で、 JSON タグで空白を含むキーの書き方 omitempty はカンマのあとに書くが、ではカンマを含むキーの JSON タグはどう書くのか JSON タグを指定しない場合、構造体のどのフィールドにマッピング…