fix issue in example of package gjson

This commit is contained in:
John 2021-08-20 23:15:48 +08:00
parent c5345239fc
commit ef36cf8446
3 changed files with 6 additions and 12 deletions

View File

@ -19,6 +19,7 @@ func Example_conversionNormalFormats() {
"array" : ["John", "Ming"]
}
}`
if j, err := gjson.DecodeToJson(data); err != nil {
panic(err)
} else {
@ -48,8 +49,8 @@ func Example_conversionNormalFormats() {
// YAML:
// users:
// array:
// - John
// - Ming
// - John
// - Ming
// count: 1
//
// ======================

7
go.mod
View File

@ -5,24 +5,17 @@ go 1.14
require (
github.com/BurntSushi/toml v0.3.1
github.com/clbanning/mxj v1.8.5-0.20200714211355-ff02cfb8ea28
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.12.0
github.com/fsnotify/fsnotify v1.4.9
github.com/gogf/mysql v1.6.1-0.20210603073548-16164ae25579
github.com/gomodule/redigo v2.0.0+incompatible
github.com/gorilla/websocket v1.4.2
github.com/grokify/html-strip-tags-go v0.0.0-20190921062105-daaa06bf1aaf
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-runewidth v0.0.10 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/olekukonko/tablewriter v0.0.5
go.opentelemetry.io/otel v1.0.0-RC2
go.opentelemetry.io/otel/oteltest v1.0.0-RC2
go.opentelemetry.io/otel/trace v1.0.0-RC2
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
golang.org/x/text v0.3.6
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)

View File

@ -23,12 +23,12 @@ type (
Server struct {
name string // Unique name for instance management.
config ServerConfig // Configuration.
plugins []Plugin // Plugin array to extends server functionality.
plugins []Plugin // Plugin array to extend server functionality.
servers []*gracefulServer // Underlying http.Server array.
serverCount *gtype.Int // Underlying http.Server count.
closeChan chan struct{} // Used for underlying server closing event notification.
serveTree map[string]interface{} // The route map tree.
serveCache *gcache.Cache // Server cache for internal usage.
serveCache *gcache.Cache // Server caches for internal usage.
routesMap map[string][]registeredRouteItem // Route map mainly for route dumps and repeated route checks.
statusHandlerMap map[string][]HandlerFunc // Custom status handler map.
sessionManager *gsession.Manager // Session manager.
@ -142,7 +142,7 @@ var (
serverMapping = gmap.NewStrAnyMap(true)
// serverRunning marks the running server count.
// If there no successful server running or all servers shutdown, this value is 0.
// If there is no successful server running or all servers' shutdown, this value is 0.
serverRunning = gtype.NewInt()
// wsUpGrader is the default up-grader configuration for websocket.