go-json/option.go

16 lines
346 B
Go
Raw Permalink Normal View History

2020-09-16 12:23:43 +03:00
package json
2021-01-31 16:45:59 +03:00
type EncodeOptionFunc func(EncodeOption) EncodeOption
2020-09-16 12:23:43 +03:00
2021-01-31 16:45:59 +03:00
func UnorderedMap() func(EncodeOption) EncodeOption {
return func(opt EncodeOption) EncodeOption {
return opt | EncodeOptionUnorderedMap
2020-09-16 12:23:43 +03:00
}
}
2021-03-27 06:18:19 +03:00
func Debug() func(EncodeOption) EncodeOption {
return func(opt EncodeOption) EncodeOption {
return opt | EncodeOptionDebug
}
}