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

Trivial documentation bug in README.md #3

Closed
tomparkin opened this issue Mar 19, 2020 · 1 comment
Closed

Trivial documentation bug in README.md #3

tomparkin opened this issue Mar 19, 2020 · 1 comment

Comments

@tomparkin
Copy link

README.md has the following example:

func main() {
	// get clock ticks, this will return the same as C.sysconf(C._SC_CLK_TCK)
	clktck, err := sysconf.Sysconf(sysconf.SC_CLK_TCK)
	if err != nil {
		fmt.Printf("SC_CLK_TCK: %v\n", clktck)
	}
}

I think the if block should execute if there is no error, i.e. if err == nil.

Currently the example is printing the value of clktck if an error occurred.

@tklauser
Copy link
Owner

Thanks! Pushed 9251390 with a fix.

tklauser added a commit that referenced this issue Apr 21, 2020
Same as commit 9251390 ("README.md: fix err check in example"), but
in example_test.go

Updates #3

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
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