mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-17 19:43:02 -06:00
migrate go version to 1.17 (#203)
* migrate go version to 1.17 * update contributing
This commit is contained in:
parent
e681aac589
commit
f2e5bedea6
282 changed files with 11863 additions and 12600 deletions
45
vendor/github.com/goccy/go-json/option.go
generated
vendored
45
vendor/github.com/goccy/go-json/option.go
generated
vendored
|
|
@ -1,15 +1,46 @@
|
|||
package json
|
||||
|
||||
type EncodeOptionFunc func(EncodeOption) EncodeOption
|
||||
import (
|
||||
"github.com/goccy/go-json/internal/decoder"
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
)
|
||||
|
||||
func UnorderedMap() func(EncodeOption) EncodeOption {
|
||||
return func(opt EncodeOption) EncodeOption {
|
||||
return opt | EncodeOptionUnorderedMap
|
||||
type EncodeOption = encoder.Option
|
||||
type EncodeOptionFunc func(*EncodeOption)
|
||||
|
||||
// UnorderedMap doesn't sort when encoding map type.
|
||||
func UnorderedMap() EncodeOptionFunc {
|
||||
return func(opt *EncodeOption) {
|
||||
opt.Flag |= encoder.UnorderedMapOption
|
||||
}
|
||||
}
|
||||
|
||||
func Debug() func(EncodeOption) EncodeOption {
|
||||
return func(opt EncodeOption) EncodeOption {
|
||||
return opt | EncodeOptionDebug
|
||||
// Debug outputs debug information when panic occurs during encoding.
|
||||
func Debug() EncodeOptionFunc {
|
||||
return func(opt *EncodeOption) {
|
||||
opt.Flag |= encoder.DebugOption
|
||||
}
|
||||
}
|
||||
|
||||
// Colorize add an identifier for coloring to the string of the encoded result.
|
||||
func Colorize(scheme *ColorScheme) EncodeOptionFunc {
|
||||
return func(opt *EncodeOption) {
|
||||
opt.Flag |= encoder.ColorizeOption
|
||||
opt.ColorScheme = scheme
|
||||
}
|
||||
}
|
||||
|
||||
type DecodeOption = decoder.Option
|
||||
type DecodeOptionFunc func(*DecodeOption)
|
||||
|
||||
// DecodeFieldPriorityFirstWin
|
||||
// in the default behavior, go-json, like encoding/json,
|
||||
// will reflect the result of the last evaluation when a field with the same name exists.
|
||||
// This option allow you to change this behavior.
|
||||
// this option reflects the result of the first evaluation if a field with the same name exists.
|
||||
// This behavior has a performance advantage as it allows the subsequent strings to be skipped if all fields have been evaluated.
|
||||
func DecodeFieldPriorityFirstWin() DecodeOptionFunc {
|
||||
return func(opt *DecodeOption) {
|
||||
opt.Flags |= decoder.FirstWinOption
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue