Don't create new options
This commit is contained in:
parent
742b83cbb1
commit
33b1cea29d
10
service.go
10
service.go
@ -68,17 +68,11 @@ func (s *service) Init(opts ...Option) {
|
|||||||
// close init
|
// close init
|
||||||
close(s.init)
|
close(s.init)
|
||||||
|
|
||||||
// We might get more command flags or the action here
|
// process options
|
||||||
// This is pretty ugly, find a better way
|
|
||||||
options := newOptions()
|
|
||||||
options.Cmd = s.opts.Cmd
|
|
||||||
|
|
||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
o(&options)
|
o(&s.opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.opts.Cmd = options.Cmd
|
|
||||||
|
|
||||||
// Initialise the command flags, overriding new service
|
// Initialise the command flags, overriding new service
|
||||||
s.opts.Cmd.Init(
|
s.opts.Cmd.Init(
|
||||||
cmd.Broker(&s.opts.Broker),
|
cmd.Broker(&s.opts.Broker),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user