]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: eliminate format string FmtUnsigned support
authorJosh Bleecher Snyder <josharian@gmail.com>
Mon, 7 Nov 2016 19:52:21 +0000 (11:52 -0800)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 14 Mar 2017 02:34:31 +0000 (02:34 +0000)
Passes toolstash -cmp.

Change-Id: I678fc40c0f2a6e9a434bcdd4ea17bb7f319a6063
Reviewed-on: https://go-review.googlesource.com/38144
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/fmt.go

index 73d5c086d425bd0f57baadc24fca0ed732715590..ba3c1d8bb9874c352916bc3a60c338bb5381d9ab 100644 (file)
@@ -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':