]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/{go,compile}: run gofmt
authorThan McIntosh <thanm@google.com>
Thu, 29 Jun 2023 15:44:04 +0000 (11:44 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 29 Jun 2023 16:02:11 +0000 (16:02 +0000)
Ran gofmt on a couple of Go source files that needed it.

Change-Id: I0e9f78831f531a728b892a63c6e0c517d92b11a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/507156
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/compile/internal/devirtualize/devirtualize.go
src/cmd/compile/internal/typecheck/stmt.go
src/cmd/compile/internal/typecheck/subr.go
src/cmd/go/internal/gover/gover.go
src/cmd/go/main.go

index cfeb8d8ee971deccb1005367c647fab7a7e463cc..b156b663129dc63df1c1e27f646098682c0bc1c1 100644 (file)
@@ -4,11 +4,11 @@
 
 // Package devirtualize implements two "devirtualization" optimization passes:
 //
-// - "Static" devirtualization which replaces interface method calls with
-//   direct concrete-type method calls where possible.
-// - "Profile-guided" devirtualization which replaces indirect calls with a
-//   conditional direct call to the hottest concrete callee from a profile, as
-//   well as a fallback using the original indirect call.
+//   - "Static" devirtualization which replaces interface method calls with
+//     direct concrete-type method calls where possible.
+//   - "Profile-guided" devirtualization which replaces indirect calls with a
+//     conditional direct call to the hottest concrete callee from a profile, as
+//     well as a fallback using the original indirect call.
 package devirtualize
 
 import (
index c434ff9118735d8cf36eb1eee5ef19216c434f61..9dea261bb9acd16d3984f8cb6d538cb3eb5c8dd9 100644 (file)
@@ -607,7 +607,7 @@ func tcSwitchType(n *ir.SwitchStmt) {
                        if !n1.Type().IsInterface() {
                                why := ImplementsExplain(n1.Type(), t)
                                if why != "" {
-                                       base.ErrorfAt(ncase.Pos(), errors.ImpossibleAssert, "impossible type switch case: %L cannot have dynamic type %v (%s)" , guard.X, n1.Type(), why)
+                                       base.ErrorfAt(ncase.Pos(), errors.ImpossibleAssert, "impossible type switch case: %L cannot have dynamic type %v (%s)", guard.X, n1.Type(), why)
                                }
                                continue
                        }
index 8554805fa63ed26b0feae63a08aece30e8491adc..2bb978a0fa60efe08363a64c279a752bceafceaa 100644 (file)
@@ -713,12 +713,12 @@ func ImplementsExplain(t, iface *types.Type) string {
                return fmt.Sprintf("%v does not implement %v (%v method is marked 'nointerface')", t, iface, missing.Sym)
        } else if have != nil && have.Sym == missing.Sym {
                return fmt.Sprintf("%v does not implement %v (wrong type for %v method)\n"+
-               "\t\thave %v%S\n\t\twant %v%S", t, iface, missing.Sym, have.Sym, have.Type, missing.Sym, missing.Type)
+                       "\t\thave %v%S\n\t\twant %v%S", t, iface, missing.Sym, have.Sym, have.Type, missing.Sym, missing.Type)
        } else if ptr != 0 {
                return fmt.Sprintf("%v does not implement %v (%v method has pointer receiver)", t, iface, missing.Sym)
        } else if have != nil {
                return fmt.Sprintf("%v does not implement %v (missing %v method)\n"+
-               "\t\thave %v%S\n\t\twant %v%S", t, iface, missing.Sym, have.Sym, have.Type, missing.Sym, missing.Type)
+                       "\t\thave %v%S\n\t\twant %v%S", t, iface, missing.Sym, have.Sym, have.Type, missing.Sym, missing.Type)
        }
        return fmt.Sprintf("%v does not implement %v (missing %v method)", t, iface, missing.Sym)
 }
index 247717125ba26287e806a9c5dddb76424d6e943a..ce2242d522659cbc7d5fef72a18c820bdab8676a 100644 (file)
@@ -111,7 +111,6 @@ func IsPrerelease(x string) bool {
 //
 //     Prev("1.2") = "1.1"
 //     Prev("1.3rc4") = "1.2"
-//
 func Prev(x string) string {
        v := parse(x)
        if cmpInt(v.minor, "1") <= 0 {
index 00b0a2b78ba4a68ff762b1893c025b6675e65c2b..2898c68049659acc9ae4d3dc55eca68a1ea4f398 100644 (file)
@@ -300,10 +300,10 @@ func maybeStartTrace(pctx context.Context) context.Context {
 //
 // We have to handle the -C flag this way for two reasons:
 //
-//   1. Toolchain selection needs to be in the right directory to look for go.mod and go.work.
+//  1. Toolchain selection needs to be in the right directory to look for go.mod and go.work.
 //
-//   2. A toolchain switch later on reinvokes the new go command with the same arguments.
-//      The parent toolchain has already done the chdir; the child must not try to do it again.
+//  2. A toolchain switch later on reinvokes the new go command with the same arguments.
+//     The parent toolchain has already done the chdir; the child must not try to do it again.
 func handleChdirFlag() {
        _, used := lookupCmd(os.Args[1:])
        used++ // because of [1:]