You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test client is only intended for local development and testing, not as a
go-installable, so remove it from the main go.mod hierarchy to reduce
dependencies for upstream consumers.
bump go.mod to min go to 1.13 (GO111MODULE where defaulted to auto)
update to v6 for the min go version bump
Volumeint`short:"c" long:"count" default:"1000" description:"Number of stats to send. Volume."`
28
-
Nilbool`long:"nil" description:"Use nil client"`
29
-
Bufferedbool`long:"buffered" description:"Use a buffered client"`
30
-
Duration time.Duration`short:"d" long:"duration" default:"10s" description:"How long to spread the volume across. For each second of duration, volume/seconds events will be sent."`
20
+
HostPortstring`name:"host" default:"127.0.0.1:8125" help:"host:port of statsd server"`
Volumeint`name:"count" short:"c" default:"1000" help:"Number of stats to send. Volume."`
27
+
Nilbool`name:"nil" help:"Use nil client"`
28
+
Bufferedbool`name:"buffered" help:"Use a buffered client"`
29
+
Duration time.Duration`name:"duration" short:"d" default:"10s" help:"How long to spread the volume across. For each second of duration, volume/seconds events will be sent."`
31
30
}
32
31
33
32
// parse said flags
34
-
_, err:=flags.Parse(&opts)
35
-
iferr!=nil {
36
-
ife, ok:=err.(*flags.Error); ok {
37
-
ife.Type==flags.ErrHelp {
38
-
os.Exit(0)
39
-
}
40
-
}
41
-
fmt.Printf("Error: %+v\n", err)
42
-
os.Exit(1)
43
-
}
33
+
kong.Parse(&opts,
34
+
kong.Name("test-client"),
35
+
kong.UsageOnError(),
36
+
)
37
+
fmt.Printf("%+v\n", opts)
44
38
45
39
ifopts.Nil&&opts.Buffered {
46
40
fmt.Printf("Specifying both nil and buffered together is invalid\n")
0 commit comments