Skip to content

Commit

Permalink
Fix smaller code-style / linter issues
Browse files Browse the repository at this point in the history
Fix smaller code-style / linter issues
  • Loading branch information
stv0g committed Jan 22, 2023
1 parent 976e12c commit 73f2585
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cmd/stun-bench/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func main() { // nolint:gocognit
req := stun.New()
for {
if *realRand {
if _, err := rand.Read(req.TransactionID[:]); err != nil {
if _, err := rand.Read(req.TransactionID[:]); err != nil { //nolint:gosec
log.Fatal("rand.Read failed:", err)
}
} else {
Expand Down
19 changes: 10 additions & 9 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ type (
// first error. To prevent allocations, pass pointers to values.
//
// Example:
// var (
// t = BindingRequest
// username = NewUsername("username")
// nonce = NewNonce("nonce")
// realm = NewRealm("example.org")
// )
// m := new(Message)
// m.Build(t, username, nonce, realm) // 4 allocations
// m.Build(&t, &username, &nonce, &realm) // 0 allocations
//
// var (
// t = BindingRequest
// username = NewUsername("username")
// nonce = NewNonce("nonce")
// realm = NewRealm("example.org")
// )
// m := new(Message)
// m.Build(t, username, nonce, realm) // 4 allocations
// m.Build(&t, &username, &nonce, &realm) // 0 allocations
//
// See BenchmarkBuildOverhead.
func (m *Message) Build(setters ...Setter) error {
Expand Down

0 comments on commit 73f2585

Please sign in to comment.