Просмотр исходного кода

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 лет назад
Родитель
Сommit
4ac0da889f
Аккаунт пользователя с таким Email не найден
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