github.com/powerman/golang-tools@v0.1.11-0.20220410185822-5ad214d8d803/go/analysis/unitchecker/main.go (about) 1 // Copyright 2018 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build ignore 6 // +build ignore 7 8 // This file provides an example command for static checkers 9 // conforming to the github.com/powerman/golang-tools/go/analysis API. 10 // It serves as a model for the behavior of the cmd/vet tool in $GOROOT. 11 // Being based on the unitchecker driver, it must be run by go vet: 12 // 13 // $ go build -o unitchecker main.go 14 // $ go vet -vettool=unitchecker my/project/... 15 // 16 // For a checker also capable of running standalone, use multichecker. 17 package main 18 19 import ( 20 "github.com/powerman/golang-tools/go/analysis/unitchecker" 21 22 "github.com/powerman/golang-tools/go/analysis/passes/asmdecl" 23 "github.com/powerman/golang-tools/go/analysis/passes/assign" 24 "github.com/powerman/golang-tools/go/analysis/passes/atomic" 25 "github.com/powerman/golang-tools/go/analysis/passes/bools" 26 "github.com/powerman/golang-tools/go/analysis/passes/buildtag" 27 "github.com/powerman/golang-tools/go/analysis/passes/cgocall" 28 "github.com/powerman/golang-tools/go/analysis/passes/composite" 29 "github.com/powerman/golang-tools/go/analysis/passes/copylock" 30 "github.com/powerman/golang-tools/go/analysis/passes/errorsas" 31 "github.com/powerman/golang-tools/go/analysis/passes/httpresponse" 32 "github.com/powerman/golang-tools/go/analysis/passes/loopclosure" 33 "github.com/powerman/golang-tools/go/analysis/passes/lostcancel" 34 "github.com/powerman/golang-tools/go/analysis/passes/nilfunc" 35 "github.com/powerman/golang-tools/go/analysis/passes/printf" 36 "github.com/powerman/golang-tools/go/analysis/passes/shift" 37 "github.com/powerman/golang-tools/go/analysis/passes/stdmethods" 38 "github.com/powerman/golang-tools/go/analysis/passes/structtag" 39 "github.com/powerman/golang-tools/go/analysis/passes/tests" 40 "github.com/powerman/golang-tools/go/analysis/passes/unmarshal" 41 "github.com/powerman/golang-tools/go/analysis/passes/unreachable" 42 "github.com/powerman/golang-tools/go/analysis/passes/unsafeptr" 43 "github.com/powerman/golang-tools/go/analysis/passes/unusedresult" 44 ) 45 46 func main() { 47 unitchecker.Main( 48 asmdecl.Analyzer, 49 assign.Analyzer, 50 atomic.Analyzer, 51 bools.Analyzer, 52 buildtag.Analyzer, 53 cgocall.Analyzer, 54 composite.Analyzer, 55 copylock.Analyzer, 56 errorsas.Analyzer, 57 httpresponse.Analyzer, 58 loopclosure.Analyzer, 59 lostcancel.Analyzer, 60 nilfunc.Analyzer, 61 printf.Analyzer, 62 shift.Analyzer, 63 stdmethods.Analyzer, 64 structtag.Analyzer, 65 tests.Analyzer, 66 unmarshal.Analyzer, 67 unreachable.Analyzer, 68 unsafeptr.Analyzer, 69 unusedresult.Analyzer, 70 ) 71 }