Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = SCAnalyzer.Analyzer
View Source
var SCAnalyzer = lint.InitializeAnalyzer(&lint.Analyzer{ Analyzer: &analysis.Analyzer{ Name: "S1025", Run: run, Requires: []*analysis.Analyzer{buildir.Analyzer, inspect.Analyzer, generated.Analyzer}, }, Doc: &lint.RawDocumentation{ Title: `Don't use \'fmt.Sprintf("%s", x)\' unnecessarily`, Text: `In many instances, there are easier and more efficient ways of getting a value's string representation. Whenever a value's underlying type is a string already, or the type has a String method, they should be used directly. Given the following shared definitions type T1 string type T2 int func (T2) String() string { return "Hello, world" } var x string var y T1 var z T2 we can simplify fmt.Sprintf("%s", x) fmt.Sprintf("%s", y) fmt.Sprintf("%s", z) to x string(y) z.String() `, Since: "2017.1", MergeIf: lint.MergeIfAll, }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.