Commit d27dfd21 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/api: reduce stutter in runtime type stubs

LGTM=khr
R=khr
CC=dvyukov, golang-codereviews
https://golang.org/cl/132770044
parent 1a1d4323
...@@ -378,10 +378,12 @@ func (w *Walker) parseFile(dir, file string) (*ast.File, error) { ...@@ -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) { 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. // Just enough to keep the api checker happy.
src := "package runtime; type maptype struct{}; type _type struct{}; type alg struct{};" + src := "package runtime; type (" +
" type mspan struct{}; type m struct{}; type lock struct{}; type slicetype struct{};" + " maptype struct{}; _type struct{}; alg struct{};" +
" type iface struct{}; type eface struct{}; type interfacetype struct{}; type itab struct{};" + " mspan struct{}; m struct{}; lock struct{}; slicetype struct{};" +
" type mcache struct{}; type bucket struct{}; type sudog struct{}; type g 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) f, err = parser.ParseFile(fset, filename, src, 0)
if err != nil { if err != nil {
log.Fatalf("incorrect generated file: %s", err) log.Fatalf("incorrect generated file: %s", err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment