-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: use command replace io #23
Conversation
@zaunist cc. |
Codecov Report
@@ Coverage Diff @@
## master #23 +/- ##
=======================================
Coverage 75.00% 75.00%
=======================================
Files 2 2
Lines 20 20
=======================================
Hits 15 15
Misses 4 4
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. |
You can view npm config docs. Can found |
internal/action/handle.go
Outdated
flag, err := registry.WriteNpm(uri) | ||
if flag { | ||
logger.Success(internal.StringJoin("[Grm]: use", name, "success~", registry.Eol())) | ||
return 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use if err != nil
? Even though this style is silly, we should use a uniform style for our code. The use of if flag
here also causes the call to writeNpm to return 0
and return 1
in a different style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. May we can discuss how to unify the norms.Because in project. we have process state code. In my mind. Just like process state code we can provide a enum,
It look like
eg:
const (
NORMAL = 1 << iota
ABORT
)
And for other err. May if err !=nil
. My mind don't have an answer for now :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense to me.
Co-authored-by: 失眠是真滴难受 <imbozhong@gmail.com>
I push new code. This commit I just kept the err return at |
@zaunist cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Background
Description
WriteNpm
func.Others