Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@derberni

Description

@derberni

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions