knadh / koanf

Simple, extremely lightweight, extensible, configuration management library for Go. Support for JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

etcd provider does not support this method

lyonnee opened this issue · comments

Describe the bug
When I use etcd as provider, I get this error message

To Reproduce
image

Expected behavior
Can parse my configuration information from etcd

Please provide the following information):

  • OS: osx
  • Koanf Version v2.0.0
  • providers/etcd Version v0.1.1

nil checking the returned object is pretty bad imo. The Provider function should return a second error value.

This will lead to defensive programming where you start to distrust returned pointer values.

It would be great if you could provide a way to setup a test environment quickly.

@jxsl13
I fully agree with your opinion that judging whether Provider is equal to nil is a very bad approach. I am planning to modify the source code here to initiate PR

The new PR is here #217