]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: remove unused field parameter
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 5 Mar 2017 12:42:55 +0000 (13:42 +0100)
committerRobert Griesemer <gri@golang.org>
Mon, 6 Mar 2017 05:04:51 +0000 (05:04 +0000)
Found by github.com/mvdan/unparam.

Change-Id: Ie26e963176eb7afb35d16fed5cbca6530f7731c3
Reviewed-on: https://go-review.googlesource.com/37832
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/go/types/typexpr.go

index 1e906fc4d88dd82098ecbed4b033ac114ffa3a40..5f1587bf0f54c5f843c6fadc9898fec445929821 100644 (file)
@@ -623,7 +623,7 @@ func (check *Checker) structType(styp *Struct, e *ast.StructType, path []*TypeNa
        // current field typ and tag
        var typ Type
        var tag string
-       add := func(field *ast.Field, ident *ast.Ident, anonymous bool, pos token.Pos) {
+       add := func(ident *ast.Ident, anonymous bool, pos token.Pos) {
                if tag != "" && tags == nil {
                        tags = make([]string, len(fields))
                }
@@ -646,7 +646,7 @@ func (check *Checker) structType(styp *Struct, e *ast.StructType, path []*TypeNa
                if len(f.Names) > 0 {
                        // named fields
                        for _, name := range f.Names {
-                               add(f, name, false, name.Pos())
+                               add(name, false, name.Pos())
                        }
                } else {
                        // anonymous field
@@ -684,7 +684,7 @@ func (check *Checker) structType(styp *Struct, e *ast.StructType, path []*TypeNa
                                        continue
                                }
                        }
-                       add(f, name, true, pos)
+                       add(name, true, pos)
                }
        }