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

Return errors instead of using log.Printf in library code #35

Open
derberni opened this issue Dec 29, 2022 · 0 comments
Open

Return errors instead of using log.Printf in library code #35

derberni opened this issue Dec 29, 2022 · 0 comments

Comments

@derberni
Copy link

At a couple of places, the current implementation does not return an error when something fails, but instead does something like the following (taken from systray_windows.go, MenuItem.SetIcon)

	if err != nil {
		log.Printf("systray error: unable to write icon data to temp file: %s\n", err)
		return
	}

However, we would like to handle the error in our own application (and not log it at all). One might even argue, that a library should not write any log messages at all, and only return errors to the main application.

Any chance of a PR changing this behavior getting accepted? After all, it would break backwards compatibility because the function signatures would change from e.g. SetIcon(iconBytes []byte) to SetIcon(iconBytes []byte) error

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