simplifycompositelit

package
v0.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

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.

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

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL