diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2014-08-21 10:16:49 -0700 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2014-08-21 10:16:49 -0700 |
| commit | d27dfd2152efd34d0603fdb105b1aaeb0f8b492e (patch) | |
| tree | 0f37f4a0f698ee52c1026519176e2c887b85276e /src | |
| parent | 1a1d43239e42184694d0207ffad9bbb77d8e8f76 (diff) | |
| download | go-d27dfd2152efd34d0603fdb105b1aaeb0f8b492e.tar.xz | |
cmd/api: reduce stutter in runtime type stubs
LGTM=khr
R=khr
CC=dvyukov, golang-codereviews
https://golang.org/cl/132770044
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/api/goapi.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go index d7b16a0c4f..07f007fdfb 100644 --- a/src/cmd/api/goapi.go +++ b/src/cmd/api/goapi.go @@ -378,10 +378,12 @@ func (w *Walker) parseFile(dir, file string) (*ast.File, error) { } if w.context != nil && file == fmt.Sprintf("zruntime_defs_%s_%s.go", w.context.GOOS, w.context.GOARCH) { // Just enough to keep the api checker happy. - src := "package runtime; type maptype struct{}; type _type struct{}; type alg struct{};" + - " type mspan struct{}; type m struct{}; type lock struct{}; type slicetype struct{};" + - " type iface struct{}; type eface struct{}; type interfacetype struct{}; type itab struct{};" + - " type mcache struct{}; type bucket struct{}; type sudog struct{}; type g struct{}" + src := "package runtime; type (" + + " maptype struct{}; _type struct{}; alg struct{};" + + " mspan struct{}; m struct{}; lock struct{}; slicetype struct{};" + + " iface struct{}; eface struct{}; interfacetype struct{}; itab struct{};" + + " mcache struct{}; bucket struct{}; sudog struct{}; g struct{};" + + ")" f, err = parser.ParseFile(fset, filename, src, 0) if err != nil { log.Fatalf("incorrect generated file: %s", err) |
