Skip to content

x/exp/cmd/apidiff: incorrectly reports breaking change on numeric const using scientific e-notation #44796

@noahdietz

Description

@noahdietz

What version of Go are you using (go version)?

$ go version
go version go1.16 darwin/amd64

Also happens on go version go1.16 linux/amd64.

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOOS="darwin"

Also happens on linux/amd64.

What did you do?

go install golang.org/x/exp/cmd/apidiff@latest
git clone https://github.com/googleapis/google-cloud-go gocloud
cd gocloud/pubsub
apidiff -w pkg.master cloud.google.com/go/pubsub
apidiff -incompatible pkg.master cloud.google.com/go/pubsub 

What did you expect to see?

Nothing, no breaking changes.

What did you see instead?

- MaxPublishRequestBytes: value changed from 0.000582077 to 10000000

The LoC in question is here.

In short, it reads:

const (
  MaxPublishRequestBytes = 1e7
)

We are trying to (re)enable apidiff in cloud.google.com/go CI, but can't enable it until this is fixed. We can always workaround this specific error though, I guess.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions