-
Notifications
You must be signed in to change notification settings - Fork 911
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
Make staticcheck great again #3103
Conversation
d412f0d
to
4482a59
Compare
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.
I stopped at 83/165 files, will do the rest later
@@ -40,7 +40,7 @@ func NewDataBlob(data []byte, encodingTypeStr string) *commonpb.DataBlob { | |||
encodingType, ok := enumspb.EncodingType_value[encodingTypeStr] | |||
if !ok || (enumspb.EncodingType(encodingType) != enumspb.ENCODING_TYPE_PROTO3 && | |||
enumspb.EncodingType(encodingType) != enumspb.ENCODING_TYPE_JSON) { | |||
panic(fmt.Sprintf("Invalid encoding: \"%v\"", encodingTypeStr)) | |||
panic(fmt.Sprintf("Invalid encoding: %v", encodingTypeStr)) |
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.
maybe %q
?
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.
I thought about it but I don't like %q
. Because everytime we log the error in JSON logger (which is default) it gets only worse.
ba838d9
to
5aa58a7
Compare
@@ -1209,32 +1212,6 @@ func (e *MutableStateImpl) DeleteUserTimer( | |||
return nil | |||
} | |||
|
|||
// nolint:unused |
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.
hey, I removed this first in #3055 🙂
@@ -4566,7 +4543,7 @@ func (e *MutableStateImpl) createCallerError( | |||
return serviceerror.NewInvalidArgument(msg) | |||
} | |||
|
|||
func (_ *MutableStateImpl) unixNanoToTime( | |||
func (*MutableStateImpl) unixNanoToTime( |
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.
move this into common/primitives/timestamp
or common/util
?
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.
3 usages of this function are:
e.unixNanoToTime(now.UnixNano())
🤦
5aa58a7
to
e3b009f
Compare
What changed?
Make staticcheck great again.
Why?
To enable automatic static analysis.
How did you test it?
make staticcheck
Potential risks
No risks.
Is hotfix candidate?
No.