-
Notifications
You must be signed in to change notification settings - Fork 829
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
Fixes to appease go static checker #1589
base: master
Are you sure you want to change the base?
Conversation
@@ -51,7 +51,6 @@ func registerInterfaceProvider(eh EventInterfaceProvider) { | |||
// fmt.Errorf("event %s already registered", eh.Type()) | |||
} | |||
registeredInterfaceProviders[eh.Type()] = eh | |||
return |
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.
Unnecessary return removed
@@ -52,6 +52,4 @@ func ExampleApplication() { | |||
// Delete the application we created. | |||
err = dg.ApplicationDelete(ap.ID) | |||
log.Printf("Delete: err: %+v\n", err) | |||
|
|||
return |
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.
Unnecessary return removed
@@ -1061,7 +1062,7 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) { | |||
oldCopy := *old | |||
t.BeforeUpdate = &oldCopy | |||
} | |||
err = s.ChannelAdd(t.Channel) |
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.
This error value is never used
@@ -1078,7 +1079,7 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) { | |||
oldCopy := *old | |||
t.BeforeUpdate = &oldCopy | |||
} | |||
err = s.ChannelAdd(t.Channel) |
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.
This error value is never used
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 think it's better to fix the shadowing rather than its consequences.
@@ -501,8 +501,6 @@ func (v *VoiceConnection) onEvent(message []byte) { | |||
default: | |||
v.log(LogDebug, "unknown voice operation, %d, %s", e.Operation, string(e.RawData)) | |||
} | |||
|
|||
return |
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.
Unnecessary return removed
@@ -787,7 +785,8 @@ func (v *VoiceConnection) opusSender(udpConn *net.UDPConn, close <-chan struct{} | |||
sequence++ | |||
} | |||
|
|||
if (timestamp + uint32(size)) >= 0xFFFFFFFF { |
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.
The value given is greater than the max value of Uint32 which is impossible. Instead, we should check for integer ovrflow.
@FedorLap2006 @bwmarrin bump |
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
@FedorLap2006 Can you merge please? I don't have merge perms |
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.
After looking into it, I would change a couple of things, but other than that still LGTM.
@@ -1078,7 +1079,7 @@ func (s *State) OnInterface(se *Session, i interface{}) (err error) { | |||
oldCopy := *old | |||
t.BeforeUpdate = &oldCopy | |||
} | |||
err = s.ChannelAdd(t.Channel) |
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 think it's better to fix the shadowing rather than its consequences.
Resolve some complaints from the static go checker