]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add -url flag, print URL with error messages if applicable
authorRobert Griesemer <gri@golang.org>
Wed, 15 Mar 2023 21:03:49 +0000 (14:03 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 16 Mar 2023 20:22:11 +0000 (20:22 +0000)
commit7a21f799a5ac23d3e191a106d71af9b8f65279fd
tree837cd45204974ae4f5ccac67b44105f3055afcfa
parente91876f4406a89eb0b0c07e93a6ae4e4f32d48b6
cmd/compile: add -url flag, print URL with error messages if applicable

If the -url flag is provided, when encountering a type checking error,
the compiler will also print a URL to a more detailed description of
the error and an example, if available.

Example uses:

        go tool compile -url filename.go
        go build -gcflags=-url pkg/path

For instance, a duplicate declaration of an identifier will report

        https://pkg.go.dev/internal/types/errors#DuplicateDecl

We may refine the provided URL over time.

Change-Id: Iabe3008a49d9dd88bf690f99e4a4a5432dc08786
Reviewed-on: https://go-review.googlesource.com/c/go/+/476716
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
src/cmd/compile/internal/base/flag.go
src/cmd/compile/internal/base/print.go