You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cat src/a/a.go
package a
const Two = 1 + "one"
$ export GOPATH=$(pwd)
$ go list -e a 2>/dev/null
a
$ go list -e a >/dev/null
# no errors
$ go list -e -export a 2>/dev/null
a
$ go list -e -export a >/dev/null
# a
src/a/a.go:3:15: cannot convert "one" (type untyped string) to type int
src/a/a.go:3:15: invalid operation: 1 + "one" (mismatched types int and string)
$ go help list | grep -A5 ' -e '
The -e flag changes the handling of erroneous packages, those that
cannot be found or are malformed. By default, the list command
prints an error to standard error for each erroneous package and
omits the packages from consideration during the usual printing.
With the -e flag, the list command never prints errors to standard
error and instead processes the erroneous packages with the usual
printing. Erroneous packages will have a non-empty ImportPath and
a non-nil Error field; other information may or may not be missing
(zeroed).
The documentation for the -e flag says it "never prints errors to standard error", but errors in the build caused by the -export flag are in fact reported to stderr. Perhaps "errors" here means only the specific package-not-found and package-malformed kinds mentioned earlier, not all build errors, but it would be nice if all errors for a package, including build errors, could be funneled into its Package.Errors field.
The text was updated successfully, but these errors were encountered:
The documentation for the
-e
flag says it "never prints errors to standard error", but errors in the build caused by the-export
flag are in fact reported to stderr. Perhaps "errors" here means only the specific package-not-found and package-malformed kinds mentioned earlier, not all build errors, but it would be nice if all errors for a package, including build errors, could be funneled into its Package.Errors field.The text was updated successfully, but these errors were encountered: