Skip to content

Fixes to appease go static checker#1589

Open
Suhaibinator wants to merge 1 commit intobwmarrin:masterfrom
Suhaibinator:static-issues
Open

Fixes to appease go static checker#1589
Suhaibinator wants to merge 1 commit intobwmarrin:masterfrom
Suhaibinator:static-issues

Conversation

@Suhaibinator
Copy link
Contributor

Resolve some complaints from the static go checker

// fmt.Errorf("event %s already registered", eh.Type())
}
registeredInterfaceProviders[eh.Type()] = eh
return
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unnecessary return removed

err = dg.ApplicationDelete(ap.ID)
log.Printf("Delete: err: %+v\n", err)

return
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unnecessary return removed

oldCopy := *old
t.BeforeUpdate = &oldCopy
}
err = s.ChannelAdd(t.Channel)
Copy link
Contributor Author

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

oldCopy := *old
t.BeforeUpdate = &oldCopy
}
err = s.ChannelAdd(t.Channel)
Copy link
Contributor Author

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

Copy link
Collaborator

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.

v.log(LogDebug, "unknown voice operation, %d, %s", e.Operation, string(e.RawData))
}

return
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unnecessary return removed

sequence++
}

if (timestamp + uint32(size)) >= 0xFFFFFFFF {
Copy link
Contributor Author

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.

@Suhaibinator
Copy link
Contributor Author

@FedorLap2006 @bwmarrin

@Suhaibinator
Copy link
Contributor Author

@FedorLap2006 @bwmarrin bump

Copy link
Collaborator

@FedorLap2006 FedorLap2006 left a comment

Choose a reason for hiding this comment

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

LGTM

@Suhaibinator
Copy link
Contributor Author

@FedorLap2006 Can you merge please? I don't have merge perms

Copy link
Collaborator

@FedorLap2006 FedorLap2006 left a 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.

oldCopy := *old
t.BeforeUpdate = &oldCopy
}
err = s.ChannelAdd(t.Channel)
Copy link
Collaborator

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.

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