Skip to content

proto: tests fail to build on Go 1.15 due to new vet check #1209

Closed
@saser

Description

@saser

What version of protobuf and what language are you using?
Version: v1.4.2.

$ go version
go version go1.15.2 linux/amd64

What did you do?
Go 1.15 contains a new vet check that warns for conversion of the form string(x) where x is an integer type that is not rune or byte. I initially noticed the build failure when I ran go test all in a project that uses Go 1.15 and depends on this module.

To reproduce:

$ cd $(mktemp -d)

$ go mod init test
go: creating new go.mod: module test

$ go get github.com/golang/[email protected]
go: downloading github.com/golang/protobuf v1.4.2

$ go test github.com/golang/protobuf/proto
go: downloading google.golang.org/protobuf v1.23.0
go: downloading github.com/google/go-cmp v0.4.0
# github.com/golang/protobuf/proto
[redacted $GOPATH]/pkg/mod/github.com/golang/[email protected]/proto/text_decode.go:768:10: conversion from uint64 to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
FAIL    github.com/golang/protobuf/proto [build failed]
FAIL

What did you expect to see?
Passing tests.

What did you see instead?
A build failure (see details above).

Anything else we should know about your project / environment?
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions