1
0
mirror of https://github.com/prometheus-community/postgres_exporter.git synced 2025-08-06 17:22:43 +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:
Will Rouesnel
2018-02-23 01:55:49 +11:00
parent 3e6cf08dc5
commit 989489096e
269 changed files with 35309 additions and 2017 deletions

View File

@@ -24,13 +24,15 @@ import (
"sort"
"strings"
"go/types"
"github.com/kisielk/gotool"
"golang.org/x/tools/go/loader"
"go/types"
)
var (
reportExported = flag.Bool("e", false, "Report exported variables and constants")
buildTags = flag.String("tags", "", "Build tags")
)
type object struct {
@@ -102,6 +104,9 @@ func (v *visitor) Visit(node ast.Node) ast.Visitor {
for _, val := range node.Values {
ast.Walk(v, val)
}
if node.Type != nil {
ast.Walk(v, node.Type)
}
return nil
case *ast.FuncDecl:
@@ -133,6 +138,9 @@ func main() {
}
ctx := build.Default
if *buildTags != "" {
ctx.BuildTags = strings.Fields(*buildTags)
}
loadcfg := loader.Config{
Build: &ctx,
}