Skip to content

Commit

Permalink
dns/dnsmessage: avoid string(i) where i has type int
Browse files Browse the repository at this point in the history
Instead use string(r) where r has type rune.

This is in preparation for a vet warning for string(i).

Updates golang/go#32479

Change-Id: I778323fe01eeac4a1068a350c965039eef84df30
Reviewed-on: https://go-review.googlesource.com/c/net/+/220798
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Akhil Indurti <aindurti@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Toshihiro Shiino <shiino.toshihiro@gmail.com>
  • Loading branch information
ianlancetaylor committed Feb 26, 2020
1 parent 5d076fc commit 491c5fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dns/dnsmessage/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -2140,7 +2140,7 @@ func unpackResourceBody(msg []byte, off int, hdr ResourceHeader) (ResourceBody,
return nil, off, &nestedError{name + " record", err}
}
if r == nil {
return nil, off, errors.New("invalid resource type: " + string(hdr.Type+'0'))
return nil, off, errors.New("invalid resource type: " + string(rune(hdr.Type)+'0'))
}
return r, off + int(hdr.Length), nil
}
Expand Down

0 comments on commit 491c5fc

Please sign in to comment.