From: Josh Bleecher Snyder Date: Mon, 7 Nov 2016 19:52:21 +0000 (-0800) Subject: cmd/compile: eliminate format string FmtUnsigned support X-Git-Tag: go1.9beta1~1178 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8ee37c6a66fd71fa0204204719b0489085f85ca0;p=gostls13.git cmd/compile: eliminate format string FmtUnsigned support Passes toolstash -cmp. Change-Id: I678fc40c0f2a6e9a434bcdd4ea17bb7f319a6063 Reviewed-on: https://go-review.googlesource.com/38144 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/fmt.go b/src/cmd/compile/internal/gc/fmt.go index 73d5c086d4..ba3c1d8bb9 100644 --- a/src/cmd/compile/internal/gc/fmt.go +++ b/src/cmd/compile/internal/gc/fmt.go @@ -16,14 +16,11 @@ import ( // See the respective function's documentation for details. type FmtFlag int -// TODO(gri) The ' ' flag is not used anymore in %-formats. -// Eliminate eventually. - const ( // fmt.Format flag/prec or verb FmtLeft FmtFlag = 1 << iota // '-' FmtSharp // '#' FmtSign // '+' - FmtUnsigned // ' ' (historic: u flag) + FmtUnsigned // internal use only (historic: u flag) FmtShort // verb == 'S' (historic: h flag) FmtLong // verb == 'L' (historic: l flag) FmtComma // '.' (== hasPrec) (historic: , flag) @@ -44,7 +41,7 @@ func fmtFlag(s fmt.State, verb rune) FmtFlag { flag |= FmtSign } if s.Flag(' ') { - flag |= FmtUnsigned + Fatalf("FmtUnsigned in format string") } if _, ok := s.Precision(); ok { flag |= FmtComma @@ -1701,7 +1698,6 @@ func fldconv(f *Field, flag FmtFlag) string { // "%L" print definition, not name // "%S" omit 'func' and receiver from function types, short type names -// "% v" package name, not prefix (FTypeId mode, sticky) func (t *Type) Format(s fmt.State, verb rune) { switch verb { case 'v', 'S', 'L':