cmd/link: add -h flag, for debugging, same as cmd/compile

Change-Id: I3c9b05879fe0b6e94b63e9b65e4411ba2a917134
Reviewed-on: https://go-review.googlesource.com/10705
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Russ Cox 2015-06-04 14:30:30 -04:00
parent 7e27625e25
commit a2c50ece2b
2 changed files with 4 additions and 1 deletions

View file

@ -1949,8 +1949,10 @@ func Diag(format string, args ...interface{}) {
sep = ": "
}
fmt.Printf("%s%s%s\n", tn, sep, fmt.Sprintf(format, args...))
nerrors++
if Debug['h'] != 0 {
panic("error")
}
if nerrors > 20 {
Exitf("too many errors")
}