소스 검색

profile: avoid string(int) conversion (#513)

As per the vet check being introduced in 1.15
(https://github.com/golang/go/issues/32479), conversions of the form
string(int) are flagged by go vet. The suggested fix is to instead use
string(rune).

Additionally, since google/pprof is vendored into the go tree, we avoid
test failures from vet flagging this dependency (see
CL https://go-review.googlesource.com/c/go/+/220977).
Akhil Indurti 5 년 전
부모
커밋
4ac0da889f
No account linked to committer's email address
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      profile/proto.go

+ 1
- 1
profile/proto.go 파일 보기

@@ -235,7 +235,7 @@ func decodeField(b *buffer, data []byte) ([]byte, error) {
235 235
 		b.u64 = uint64(le32(data[:4]))
236 236
 		data = data[4:]
237 237
 	default:
238
-		return nil, errors.New("unknown wire type: " + string(b.typ))
238
+		return nil, errors.New("unknown wire type: " + string(rune(b.typ)))
239 239
 	}
240 240
 
241 241
 	return data, nil