
Also do following improvements: - show proper sublinter name for megacheck sublinters - refactor and make more simple and robust megacheck merging/optimizing - improve handling of unknown linter names in //nolint directives - minimize diff of our megacheck version from the upstream, https://github.com/golang/go/issues/29612 blocks usage of the upstream version - support the new `stylecheck` linter - improve tests coverage for megacheck and nolint related cases - update and use upstream versions of unparam and interfacer instead of forked ones - don't use golangci/tools repo anymore - fix newly found issues after updating linters Also should be noted that megacheck works much faster and consumes less memory in the newest release, therefore golangci-lint works noticeably faster and consumes less memory for large repos. Relates: #314
41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
package arg
|
|
|
|
var args = map[string]int{
|
|
"(*sync.Pool).Put.x": 0,
|
|
"(*text/template.Template).Parse.text": 0,
|
|
"(io.Seeker).Seek.offset": 0,
|
|
"(time.Time).Sub.u": 0,
|
|
"append.elems": 1,
|
|
"append.slice": 0,
|
|
"bytes.Equal.a": 0,
|
|
"bytes.Equal.b": 1,
|
|
"encoding/binary.Write.data": 2,
|
|
"errors.New.text": 0,
|
|
"fmt.Printf.format": 0,
|
|
"fmt.Fprintf.format": 1,
|
|
"fmt.Sprintf.a[0]": 1,
|
|
"fmt.Sprintf.format": 0,
|
|
"len.v": 0,
|
|
"make.size[0]": 1,
|
|
"make.size[1]": 2,
|
|
"make.t": 0,
|
|
"net/url.Parse.rawurl": 0,
|
|
"os.OpenFile.flag": 1,
|
|
"os/exec.Command.name": 0,
|
|
"os/signal.Notify.c": 0,
|
|
"regexp.Compile.expr": 0,
|
|
"runtime.SetFinalizer.finalizer": 1,
|
|
"runtime.SetFinalizer.obj": 0,
|
|
"sort.Sort.data": 0,
|
|
"time.Parse.layout": 0,
|
|
"time.Sleep.d": 0,
|
|
}
|
|
|
|
func Arg(name string) int {
|
|
n, ok := args[name]
|
|
if !ok {
|
|
panic("unknown argument " + name)
|
|
}
|
|
return n
|
|
}
|