فهرست منبع

dns/dnsmessage: avoid string(i) where i has type int

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>
Ian Lance Taylor 5 سال پیش
والد
کامیت
491c5fce72
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      dns/dnsmessage/message.go

+ 1 - 1
dns/dnsmessage/message.go

@@ -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
 }