From: Cherry Mui Date: Wed, 22 Feb 2023 17:09:56 +0000 (-0500) Subject: cmd/link: make Exitf panic under -h X-Git-Tag: go1.21rc1~1514 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4304529a16774719687ff09f18a04e27aa8894c2;p=gostls13.git cmd/link: make Exitf panic under -h If the -h flag is specified, currently it makes Errorf panic, but not Exitf. Do so for Exitf as well. Change-Id: I3e8d8899fd439f7299be3f9e9a63993b04852a93 Reviewed-on: https://go-review.googlesource.com/c/go/+/470297 Run-TryBot: Cherry Mui TryBot-Result: Gopher Robot Reviewed-by: Than McIntosh --- diff --git a/src/cmd/link/internal/ld/util.go b/src/cmd/link/internal/ld/util.go index 779f4988b6..63b7e0d329 100644 --- a/src/cmd/link/internal/ld/util.go +++ b/src/cmd/link/internal/ld/util.go @@ -35,6 +35,9 @@ func Exit(code int) { func Exitf(format string, a ...interface{}) { fmt.Fprintf(os.Stderr, os.Args[0]+": "+format+"\n", a...) nerrors++ + if *flagH { + panic("error") + } Exit(2) }