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

No dec.DisallowUnknownFields() function #4948

Closed
aixeshunter opened this Issue Dec 4, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@aixeshunter
Copy link
Contributor

aixeshunter commented Dec 4, 2018

In prometheus/discovery/targetgroup/targetgroup.go file that line 81:

	dec := json.NewDecoder(bytes.NewReader(b))
	dec.DisallowUnknownFields()
	if err := dec.Decode(&g); err != nil {
		return err
	}

the dec.DisallowUnknownFields() functon call is error in my IDE.
Is that a BUG?

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Dec 4, 2018

DisallowUnknownFields() has been added to the encoding/json package in Go 1.10. You need preferably Go 1.11.2 to build Prometheus.

@aixeshunter

This comment has been minimized.

Copy link
Contributor Author

aixeshunter commented Dec 4, 2018

it works, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.