github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/arg/arg.go (about)

     1  package arg
     2  
     3  var args = map[string]int{
     4  	"(*sync.Pool).Put.x":                   0,
     5  	"(*text/template.Template).Parse.text": 0,
     6  	"(io.Seeker).Seek.offset":              0,
     7  	"(time.Time).Sub.u":                    0,
     8  	"append.elems":                         1,
     9  	"append.slice":                         0,
    10  	"bytes.Equal.a":                        0,
    11  	"bytes.Equal.b":                        1,
    12  	"encoding/binary.Write.data":           2,
    13  	"errors.New.text":                      0,
    14  	"fmt.Printf.format":                    0,
    15  	"fmt.Sprintf.a[0]":                     1,
    16  	"fmt.Sprintf.format":                   0,
    17  	"len.v":                                0,
    18  	"make.size[0]":                         1,
    19  	"make.size[1]":                         2,
    20  	"make.t":                               0,
    21  	"net/url.Parse.rawurl":                 0,
    22  	"os.OpenFile.flag":                     1,
    23  	"os/exec.Command.name":                 0,
    24  	"os/signal.Notify.c":                   0,
    25  	"regexp.Compile.expr":                  0,
    26  	"runtime.SetFinalizer.finalizer":       1,
    27  	"runtime.SetFinalizer.obj":             0,
    28  	"sort.Sort.data":                       0,
    29  	"time.Parse.layout":                    0,
    30  	"time.Sleep.d":                         0,
    31  }
    32  
    33  func Arg(name string) int {
    34  	n, ok := args[name]
    35  	if !ok {
    36  		panic("unknown argument " + name)
    37  	}
    38  	return n
    39  }