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

Use fmt.Errorf everywhere for error handling #826

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

ncopa
Copy link
Collaborator

@ncopa ncopa commented Apr 6, 2021

Issue
Fixes #227

What this PR Includes
Replace use of github.com/pkg/errors with standard fmt.Errorf

@ncopa ncopa added the chore label Apr 6, 2021
@ncopa ncopa requested a review from a team as a code owner April 6, 2021 13:53
@ncopa ncopa requested review from jasmingacic and mviitane April 6, 2021 13:53
Replace use of github.com/pkg/errors with standard fmt.Errorf

fixes k0sproject#227

Signed-off-by: Natanael Copa <ncopa@mirantis.com>
@ncopa ncopa force-pushed the std-error-handling branch from 9a914e6 to 5de216d Compare April 6, 2021 13:57
@ncopa ncopa requested a review from mikhail-sakhnov April 6, 2021 13:57
@@ -170,7 +169,7 @@ func (c *CmdOpts) startController() error {
LogLevel: c.Logging["etcd"],
}
default:
return errors.New(fmt.Sprintf("Invalid storage type: %s", c.ClusterConfig.Spec.Storage.Type))
return fmt.Errorf("Invalid storage type: %s", c.ClusterConfig.Spec.Storage.Type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually understand how the linter pass that, the errors should start with lowercase 🤔

@jnummelin jnummelin merged commit b18a14d into k0sproject:main Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate from github.com/pkg/errors to the standard library error handling
4 participants