Skip to content

Commit

Permalink
gogrep: remove unused *types.Info field from the matcher (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
quasilyte authored Feb 2, 2021
1 parent 44fade9 commit a28f25d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 1 addition & 5 deletions internal/mvdan.cc/gogrep/kludge.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ package gogrep
import (
"go/ast"
"go/token"
"go/types"
)

// This is an ugly way to use gogrep as a library.
// It can go away when there will be another option.

// Parse creates a gogrep pattern out of a given string expression.
func Parse(fset *token.FileSet, expr string) (*Pattern, error) {
m := matcher{
fset: fset,
Info: &types.Info{},
}
m := matcher{fset: fset}
node, err := m.parseExpr(expr)
if err != nil {
return nil, err
Expand Down
3 changes: 0 additions & 3 deletions internal/mvdan.cc/gogrep/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"go/ast"
"go/token"
"go/types"
)

type matcher struct {
Expand All @@ -16,8 +15,6 @@ type matcher struct {
// node values recorded by name, excluding "_" (used only by the
// actual matching phase)
values map[string]ast.Node

*types.Info
}

type varInfo struct {
Expand Down

0 comments on commit a28f25d

Please sign in to comment.