Documentation
¶
Overview ¶
Package stringbytesroundtrip implements a Go analysis linter that flags redundant round-trip type conversions: string([]byte(s)) when s is already a string, and []byte(string(b)) when b is already a []byte. Both conversions create an unnecessary intermediate copy and leave the caller with the same underlying type as the input.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "stringbytesroundtrip", Doc: "reports redundant string/[]byte round-trip conversions such as string([]byte(s)) or []byte(string(b)) that produce a wasteful intermediate copy", URL: "https://github.com/github/gh-aw/tree/main/pkg/linters/stringbytesroundtrip", Requires: []*analysis.Analyzer{inspect.Analyzer, nolint.Analyzer, filecheck.Analyzer}, Run: run, }
Analyzer is the string-bytes-roundtrip analysis pass.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.