You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2025-08-08 04:42:07 +03:00
Refactor repository layout and convert build system to Mage.
This commit implements a massive refactor of the repository, and moves the build system over to use Mage (magefile.org) which should allow seamless building across multiple platforms.
This commit is contained in:
12
tools/vendor/mvdan.cc/unparam/main.go
vendored
12
tools/vendor/mvdan.cc/unparam/main.go
vendored
@@ -6,24 +6,34 @@ package main // import "mvdan.cc/unparam"
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"go/build"
|
||||
"os"
|
||||
|
||||
"golang.org/x/tools/go/buildutil"
|
||||
|
||||
"mvdan.cc/unparam/check"
|
||||
)
|
||||
|
||||
var (
|
||||
algo = flag.String("algo", "cha", `call graph construction algorithm (cha, rta).
|
||||
in general, use cha for libraries, and rta for programs with main packages.`)
|
||||
tests = flag.Bool("tests", true, "include tests")
|
||||
exported = flag.Bool("exported", false, "inspect exported functions")
|
||||
debug = flag.Bool("debug", false, "debug prints")
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.Var((*buildutil.TagsFlag)(&build.Default.BuildTags), "tags",
|
||||
buildutil.TagsFlagDoc)
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Usage = func() {
|
||||
fmt.Fprintln(os.Stderr, "usage: unparam [flags] [package ...]")
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
flag.Parse()
|
||||
warns, err := check.UnusedParams(*tests, *exported, *debug, flag.Args()...)
|
||||
warns, err := check.UnusedParams(*tests, *algo, *exported, *debug, flag.Args()...)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
|
Reference in New Issue
Block a user