commit | abb31c2558d58013ae191d926ed7cdd9d3201762 | [log] [tgz] |
---|---|---|
author | Robert Griesemer <gri@golang.org> | Tue Oct 27 11:32:44 2020 -0700 |
committer | Robert Griesemer <gri@golang.org> | Tue Oct 27 23:30:33 2020 +0000 |
tree | a31a91af0c339d90295a85e8473cce83adc1b0fd | |
parent | 6e98406ac3e654f4df15f662f51eda46434af332 [diff] |
[dev.typeparams] cmd/compile/internal/types2: review of hilbert_test.go Primary differences: 1) syntax package is used instead of the go/* packages 2) parseSrc is a helper function that is used in place of parser.parseFile. 3) defaultImporter is a helper function providing access to an importer. f=hilbert_test.go; diff $f ../../../../go/types/$f 5c5 < package types2_test --- > package types_test 9d8 < "cmd/compile/internal/syntax" 11a11,14 > "go/ast" > "go/importer" > "go/parser" > "go/token" 15c18 < . "cmd/compile/internal/types2" --- > . "go/types" 32,33c35,36 < // TODO(gri) get rid of []bytes to string conversion below < f, err := parseSrc("hilbert.go", string(src)) --- > fset := token.NewFileSet() > f, err := parser.ParseFile(fset, "hilbert.go", src, 0) 40,41c43,44 < conf := Config{Importer: defaultImporter()} < _, err = conf.Check(f.PkgName.Value, []*syntax.File{f}, nil) --- > conf := Config{Importer: importer.Default()} > _, err = conf.Check(f.Name.Name, fset, []*ast.File{f}, nil) Change-Id: I65851725a3b6ac35b87177f90b788c469a54a986 Reviewed-on: https://go-review.googlesource.com/c/go/+/265679 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.