process opts on multiple init calls
This commit is contained in:
parent
b43985401a
commit
d7dc4e618b
@ -60,6 +60,10 @@ func (s *service) Init(opts ...Option) {
|
|||||||
// so we can call cmd.Init once.
|
// so we can call cmd.Init once.
|
||||||
select {
|
select {
|
||||||
case <-s.init:
|
case <-s.init:
|
||||||
|
// only process options
|
||||||
|
for _, o := range opts {
|
||||||
|
o(&s.opts)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
// close init
|
// close init
|
||||||
close(s.init)
|
close(s.init)
|
||||||
|
Loading…
Reference in New Issue
Block a user