Skip to content

Commit

Permalink
Fix issues found by linter.
Browse files Browse the repository at this point in the history
Fixes name of variable which does not follow Go convention (minor).
Fixes bug where error shadowing causes a hardware address get error to be ignored (major).

Signed-off-by: Jaden Weiss <[email protected]>
  • Loading branch information
niaow committed Jul 14, 2018
1 parent 14a3993 commit 2123b69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ func (u *UUID) decodeBraced(t []byte) (err error) {
func (u *UUID) decodeURN(t []byte) (err error) {
total := len(t)

urn_uuid_prefix := t[:9]
urnUUIDPrefix := t[:9]

if !bytes.Equal(urn_uuid_prefix, urnPrefix) {
if !bytes.Equal(urnUUIDPrefix, urnPrefix) {
return fmt.Errorf("uuid: incorrect UUID format: %s", t)
}

Expand Down
3 changes: 2 additions & 1 deletion generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ func (g *rfc4122Generator) getClockSequence() (uint64, uint16, error) {
func (g *rfc4122Generator) getHardwareAddr() ([]byte, error) {
var err error
g.hardwareAddrOnce.Do(func() {
if hwAddr, err := g.hwAddrFunc(); err == nil {
var hwAddr net.HardwareAddr
if hwAddr, err = g.hwAddrFunc(); err == nil {
copy(g.hardwareAddr[:], hwAddr)
return
}
Expand Down

0 comments on commit 2123b69

Please sign in to comment.