Don't create new options, update

This commit is contained in:
Asim 2016-01-16 23:10:14 +00:00
parent 6a44ebfd1f
commit f7c4304ac3

View File

@ -257,13 +257,10 @@ func (h *httpBroker) Disconnect() error {
} }
func (h *httpBroker) Init(opts ...Option) error { func (h *httpBroker) Init(opts ...Option) error {
var options Options
for _, o := range opts { for _, o := range opts {
o(&options) o(&h.opts)
} }
h.opts = options
if len(h.id) == 0 { if len(h.id) == 0 {
h.id = "broker-" + uuid.NewUUID().String() h.id = "broker-" + uuid.NewUUID().String()
} }