process opts on multiple init calls

This commit is contained in:
Asim Aslam 2017-03-30 19:44:01 +01:00
parent b43985401a
commit d7dc4e618b

View File

@ -60,6 +60,10 @@ func (s *service) Init(opts ...Option) {
// so we can call cmd.Init once.
select {
case <-s.init:
// only process options
for _, o := range opts {
o(&s.opts)
}
default:
// close init
close(s.init)