Documentation ¶
Overview ¶
Package simplifycompositelit defines an Analyzer that simplifies composite literals. https://github.com/golang/go/blob/master/src/cmd/gofmt/simplify.go https://golang.org/cmd/gofmt/#hdr-The_simplify_command
Analyzer simplifycompositelit ¶
simplifycompositelit: check for composite literal simplifications
An array, slice, or map composite literal of the form:
[]T{T{}, T{}}
will be simplified to:
[]T{{}, {}}
This is one of the simplifications that "gofmt -s" applies.
This analyzer ignores generated code.
Package simplifycompositelit defines an Analyzer that simplifies composite literals. https://github.com/golang/go/blob/master/src/cmd/gofmt/simplify.go https://golang.org/cmd/gofmt/#hdr-The_simplify_command
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Analyzer = &analysis.Analyzer{ Name: "simplifycompositelit", Doc: analysisinternal.MustExtractDoc(doc, "simplifycompositelit"), Requires: []*analysis.Analyzer{inspect.Analyzer}, Run: run, URL: "https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/simplifycompositelit", }
Functions ¶
This section is empty.
Types ¶
This section is empty.