simplifyslice

package
v0.15.3-pre.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package simplifyslice defines an Analyzer that simplifies slice statements. https://github.com/golang/go/blob/master/src/cmd/gofmt/simplify.go https://golang.org/cmd/gofmt/#hdr-The_simplify_command

Analyzer simplifyslice

simplifyslice: check for slice simplifications

A slice expression of the form:

s[a:len(s)]

will be simplified to:

s[a:]

This is one of the simplifications that "gofmt -s" applies.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "simplifyslice",
	Doc:      analysisinternal.MustExtractDoc(doc, "simplifyslice"),
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
	URL:      "https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/simplifyslice",
}

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