]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/fix: print warning to stderr, show provenance
authorRuss Cox <rsc@golang.org>
Mon, 29 Jun 2020 18:20:04 +0000 (14:20 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 12 Oct 2020 18:31:29 +0000 (18:31 +0000)
This cgo warning shows up when running "go test" in cmd/fix:

warning: no cgo types: exit status 1

(It may show up at other times too.)

Warnings belong on standard error, and while we're here,
make it say where it came from.

Change-Id: I3eaba592a219cc6abf2d584762374f9d6ec5135e
Reviewed-on: https://go-review.googlesource.com/c/go/+/240597
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/fix/typecheck.go

index 66e0cdcec056dfccf0d376c657345ed6626010be..f45155b06d8b4413c0a325543d1920518dcbb377 100644 (file)
@@ -207,7 +207,7 @@ func typecheck(cfg *TypeConfig, f *ast.File) (typeof map[interface{}]string, ass
                        return nil
                }()
                if err != nil {
-                       fmt.Printf("warning: no cgo types: %s\n", err)
+                       fmt.Fprintf(os.Stderr, "go fix: warning: no cgo types: %s\n", err)
                }
        }