Skip to content

Conversation

mmsqe
Copy link
Contributor

@mmsqe mmsqe commented Nov 9, 2023

No description provided.

@mmsqe mmsqe marked this pull request as ready for review November 9, 2023 03:27
cmd/appstate.go Outdated
@@ -40,7 +40,10 @@ func (a *appState) loadConfigFile(ctx context.Context) error {

if _, err := os.Stat(cfgPath); err != nil {
// don't return error if file doesn't exist
return nil
if os.IsExist(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

small nit but the Go docs for IsExists states, "This function predates errors.Is. It only supports errors returned by the os package. New code should use errors.Is(err, fs.ErrExist)."

Could we possibly swap the IsExists call out for errors.Is?

@mmsqe mmsqe changed the title fix: add os.IsExist check for loadConfigFile error fix: add not exist check for loadConfigFile error Nov 10, 2023
Copy link
Contributor

@jtieri jtieri left a comment

Choose a reason for hiding this comment

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

grazie!

@jtieri jtieri merged commit 9b80dd0 into cosmos:main Nov 10, 2023
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

Successfully merging this pull request may close these issues.

2 participants