File tree Expand file tree Collapse file tree 4 files changed +1
-6
lines changed
Expand file tree Collapse file tree 4 files changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,6 @@ import (
2525)
2626
2727func main () {
28- beatcmd .InitBeatCmd ()
2928 rootCmd := beatcmd .NewRootCommand (beatcmd.BeatParams {
3029 NewRunner : func (args beatcmd.RunnerParams ) (beatcmd.Runner , error ) {
3130 return beater .NewRunner (beater.RunnerParams {
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ package beatcmd
1919
2020import (
2121 cryptorand "crypto/rand"
22- "flag"
2322 "log"
2423 "math"
2524 "math/big"
@@ -39,7 +38,7 @@ import (
3938 _ "github.com/elastic/beats/v7/libbeat/publisher/queue/memqueue"
4039)
4140
42- func InitBeatCmd () {
41+ func init () {
4342 initRand ()
4443 initFlags ()
4544}
@@ -63,7 +62,6 @@ func initFlags() {
6362 }
6463 }
6564
66- flag .Parse ()
6765 if err := cfgfile .HandleFlags (); err != nil {
6866 log .Fatal (err )
6967 }
Original file line number Diff line number Diff line change @@ -275,7 +275,6 @@ func cleanup() error {
275275}
276276
277277func Main () error {
278- beatcmd .InitBeatCmd ()
279278 rootCmd := newXPackRootCommand (
280279 func (args beatcmd.RunnerParams ) (beatcmd.Runner , error ) {
281280 return beater .NewRunner (beater.RunnerParams {
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
1313)
1414
1515func TestSubCommands (t * testing.T ) {
16- beatcmd .InitBeatCmd ()
1716 rootCmd := newXPackRootCommand (func (beatcmd.RunnerParams ) (beatcmd.Runner , error ) {
1817 panic ("unexpected call" )
1918 })
You can’t perform that action at this time.
0 commit comments