lalamove / konfig

Composable, observable and performant config handling for Go for the distributed processing era

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NopWatcher doesn't implement Err method of Watcher interface

walez opened this issue · comments

commented

version: 0.4.0

Registering any loader that does not watch i.e internal uses the NopWatcher e.g FlagWatcher causes a panic.
runtime error: invalid memory address or nil pointer dereference

Traced the panic to loader.go

		        case <-wl.Done():
			if err := wl.Err(); err != nil {
				c.cfg.Logger.Get().Error(err.Error())
			}
			// the watcher is closed
			return

After the watchLoader which would have a NopWatcher as it's watcher returns a closed channel in wl.Done() the block tries to get any errors in the wl which causes a panic.

Thanks! Will address ASAP