Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #5 from shurcooL/early-2017-updates

Sync gostringer with latest stringer for Go 1.8.
  • Loading branch information...
sqs committed Apr 12, 2017
2 parents 41efc07 + c528cc8 commit cd0142490e8a1c9146039bd85409b001a97f2c30
Showing with 5 additions and 7 deletions.
  1. +5 −7 gostringer.go
@@ -65,20 +65,18 @@ import (
"fmt"
"go/ast"
"go/build"
exact "go/constant"
"go/format"
"go/importer"
"go/parser"
"go/token"
"go/types"
"io/ioutil"
"log"
"os"
"path/filepath"
"sort"
"strings"

"golang.org/x/tools/go/exact"
"golang.org/x/tools/go/types"

_ "golang.org/x/tools/go/gcimporter"
)

var (
@@ -129,7 +127,7 @@ func main() {
}

// Print the header and package clause.
g.Printf("// generated by gostringer %s; DO NOT EDIT\n", strings.Join(os.Args[1:], " "))
g.Printf("// Code generated by \"gostringer %s\"; DO NOT EDIT.\n", strings.Join(os.Args[1:], " "))
g.Printf("\n")
g.Printf("package %s", g.pkg.name)
g.Printf("\n")
@@ -261,7 +259,7 @@ func (g *Generator) parsePackage(directory string, names []string, text interfac
// check type-checks the package. The package must be OK to proceed.
func (pkg *Package) check(fs *token.FileSet, astFiles []*ast.File) {
pkg.defs = make(map[*ast.Ident]types.Object)
config := types.Config{FakeImportC: true}
config := types.Config{Importer: importer.Default(), FakeImportC: true}
info := &types.Info{
Defs: pkg.defs,
}

0 comments on commit cd01424

Please sign in to comment.
You can’t perform that action at this time.