Skip to content

Commit

Permalink
Move flag parsing into main() function
Browse files Browse the repository at this point in the history
There's no need to parse flags in in the `init()` function, so move them
into the `main()` function.
  • Loading branch information
mattbostock committed Jul 22, 2017
1 parent 089d9fb commit 01d34fd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
version = "undefined"
)

func init() {
func main() {
kingpin.Flag(
"http-advertise-addr",
"host:port to advertise to other nodes for HTTP",
Expand Down Expand Up @@ -97,9 +97,7 @@ func init() {
kingpin.Fatalf("could not parse log level %q", *level)
}
log.SetLevel(lvl)
}

func main() {
localStorage, err := tsdb.Open("data", nil, &tsdb.Options{
AppendableBlocks: 2,
MinBlockDuration: 2 * time.Hour,
Expand Down

0 comments on commit 01d34fd

Please sign in to comment.