We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
in func openPin(p Pin, write bool) Pin { }
It would be better not to call fmt.Printf() and os.Exit(1) inside openPin() instead please return p, err
The text was updated successfully, but these errors were encountered:
func openPin(p Pin, write bool) (Pin, error) { flags := os.O_RDONLY if write { flags = os.O_RDWR } f, err := os.OpenFile(fmt.Sprintf("/sys/class/gpio/gpio%d/value", p.Number), flags, 0600) if err != nil { return p, err } p.f = f return p, nil }
Sorry, something went wrong.
No branches or pull requests
in
func openPin(p Pin, write bool) Pin {
}
It would be better not to call fmt.Printf() and os.Exit(1) inside openPin()
instead please return p, err
The text was updated successfully, but these errors were encountered: