タイトルどおり。
omitemptyの前にスペースを入れるとomitemptyが有効にならない。
ビルド環境 Go1.13
NG例
type hoge struct {
Str string `json:"str, omitempty"`
}
OK
type hoge struct {
Str string `json:"str,omitempty"`
}
More than 3 years have passed since last update.
タイトルどおり。
omitemptyの前にスペースを入れるとomitemptyが有効にならない。
ビルド環境 Go1.13
NG例
type hoge struct {
Str string `json:"str, omitempty"`
}
OK
type hoge struct {
Str string `json:"str,omitempty"`
}
Register as a new user and use Qiita more conveniently