Don't create new options

This commit is contained in:
Asim Aslam 2017-04-17 14:57:43 +01:00
parent 742b83cbb1
commit 33b1cea29d

View File

@ -68,17 +68,11 @@ func (s *service) Init(opts ...Option) {
// close init
close(s.init)
// We might get more command flags or the action here
// This is pretty ugly, find a better way
options := newOptions()
options.Cmd = s.opts.Cmd
// process options
for _, o := range opts {
o(&options)
o(&s.opts)
}
s.opts.Cmd = options.Cmd
// Initialise the command flags, overriding new service
s.opts.Cmd.Init(
cmd.Broker(&s.opts.Broker),