From 4304529a16774719687ff09f18a04e27aa8894c2 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Wed, 22 Feb 2023 12:09:56 -0500 Subject: [PATCH] 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 --- src/cmd/link/internal/ld/util.go | 3 +++ 1 file changed, 3 insertions(+) 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) } -- 2.48.1