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

Documentation examples for tree.Query outdated #54

Closed
embik opened this issue Apr 17, 2016 · 1 comment
Closed

Documentation examples for tree.Query outdated #54

embik opened this issue Apr 17, 2016 · 1 comment

Comments

@embik
Copy link

embik commented Apr 17, 2016

I noticed the godoc documentation for go-toml is outdated or wrong (I'm not sure here). (t *TomlTree) Query(query string) returns (*QueryResult, error), yet the documentation is featuring a single-value assignation, for example at doc.go#L86 and doc.go#L204. The first example says

result := tree.Query("$.foo.bar.baz")  // result is 'nil' if the path is not present

which is obviously not true (anymore). It could say something like this:

result, err := tree.Query("$.foo.bar.baz")  // err is an error if the path is not present

Thanks for creating go-toml!

@pelletier
Copy link
Owner

Thank you for the feedback! I've updated the documentation to reflect the current behavior. Feel free to reopen an issue if you feel like it requires more details or is still incorrect.

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

2 participants