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

     1  // gosimple detects code that could be rewritten in a simpler way.
     2  package main // import "github.com/golangci/go-tools/cmd/gosimple"
     3  import (
     4  	"fmt"
     5  	"os"
     6  
     7  	"github.com/golangci/go-tools/lint"
     8  	"github.com/golangci/go-tools/lint/lintutil"
     9  	"github.com/golangci/go-tools/simple"
    10  )
    11  
    12  func main() {
    13  	fmt.Fprintln(os.Stderr, "Gosimple has been deprecated. Please use staticcheck instead.")
    14  	fs := lintutil.FlagSet("gosimple")
    15  	gen := fs.Bool("generated", false, "Check generated code")
    16  	fs.Parse(os.Args[1:])
    17  	c := simple.NewChecker()
    18  	c.CheckGenerated = *gen
    19  	lintutil.ProcessFlagSet([]lint.Checker{c}, fs)
    20  }