Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map type cause error "already set in map" with ErrorOnUnmatchedKeys, multiple YAML overlays #56

Open
xmlking opened this issue Jun 9, 2020 · 0 comments

Comments

@xmlking
Copy link

xmlking commented Jun 9, 2020

I am using following structs and enabled ErrorOnUnmatchedKeys

Got Error
yaml: unmarshal errors:\n line 21: key \"account\" already set in map\n line 24: key \"greeter\" already set in map\n line 27: key \"emailer\" already set in map\n line 30: key \"recorder\" already set in map

type Service struct {
	Endpoint             string   `yaml:"endpoint,omitempty"`
	Version              string   `yaml:"version,omitempty" default:"v0.1.0"`
	Deadline             uint32   `yaml:",omitempty" default:"1000000"`
}

type Configuration struct {
	Services             map[string]*Service   
}

config.yaml

services:
  account:
    endpoint: mkit.service.account
    version: v0.1.0
  greeter:
    endpoint: mkit.service.greeter
    version: v0.1.0
  emailer:
    endpoint: mkit.service.emailer
    version: v0.1.0
  recorder:
    endpoint: mkit.service.recorder
    version: v0.1.0

config.development.yaml

services:
  account:
    endpoint: mkit.service.account
    version: v0.2.0
  greeter:
    endpoint: mkit.service.greeter
    version: v0.2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant