1
0
mirror of https://github.com/golang/go synced 2024-11-15 10:30:54 -07:00
The Go programming language
Go to file
Robert Griesemer abb31c2558 [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>
2020-10-27 23:30:33 +00:00
.github
api io/fs: move FileInfo, FileMode, PathError, ErrInvalid, ... from os to io/fs 2020-10-20 02:32:41 +00:00
doc cmd/go: set TOOLEXEC_IMPORTPATH for -toolexec tools 2020-10-22 15:10:01 +00:00
lib/time lib/time, time, time/tzdata: use slim tz data format 2020-10-14 09:00:41 +00:00
misc misc/wasm: improve error message if javascript polyfills are required 2020-10-21 13:19:35 +00:00
src [dev.typeparams] cmd/compile/internal/types2: review of hilbert_test.go 2020-10-27 23:30:33 +00:00
test [dev.typeparams] cmd/compile: enable type-checking of generic code 2020-10-27 03:37:05 +00:00
.gitattributes all: treat all files as binary, but check in .bat with CRLF 2020-06-08 15:31:43 +00:00
.gitignore
AUTHORS A+C: add Kush Patel (corporate CLA for Hootsuite Inc) 2020-07-08 00:10:44 +00:00
CONTRIBUTING.md
CONTRIBUTORS CONTRIBUTORS: update for the Go 1.15 release 2020-08-10 21:51:48 +00:00
favicon.ico
LICENSE
PATENTS
README.md
robots.txt
SECURITY.md

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image 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.

Download and Install

Binary Distributions

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.

Install From Source

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.

Contributing

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.