diff --git a/.golangci.yml b/.golangci.yml index 53d4439..64bb190 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,7 @@ linters: enable: - asciicheck - bidichk - - depguard + # - depguard - dogsled - durationcheck - errcheck @@ -56,4 +56,4 @@ issues: - linters: - forbidigo path: cmd/ - text: "use of `fmt.Print" ## allow fmt.Print in cmd directory + text: "use of `fmt.Print" ## allow fmt.Print in cmd directory diff --git a/pkg/funder/funder.go b/pkg/funder/funder.go index 1f9bde0..25674ea 100644 --- a/pkg/funder/funder.go +++ b/pkg/funder/funder.go @@ -21,10 +21,12 @@ import ( type FunderOptions func(*Options) +// Options represents funder options type Options struct { log logging.Logger } +// DefaultOptions returns default options func DefaultOptions() *Options { return &Options{ log: logging.New(os.Stdout, 4), @@ -46,6 +48,7 @@ func Fund( options ...FunderOptions, ) error { var err error + opts := DefaultOptions() for _, opt := range options { opt(opts) @@ -65,12 +68,6 @@ func Fund( } } - // TODO: make logging configurable in beekeeper, use WithOptions - // if log == nil { - // //dicard - // log = logging.New(os.Stdout, logging.LevelInfo) - // } - opts.log.Infof("node funder started...") defer opts.log.Info("node funder finished")