Skip to content

Commit d27dfd2

Browse files
committed
cmd/api: reduce stutter in runtime type stubs
LGTM=khr R=khr CC=dvyukov, golang-codereviews https://golang.org/cl/132770044
1 parent 1a1d432 commit d27dfd2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/cmd/api/goapi.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,12 @@ func (w *Walker) parseFile(dir, file string) (*ast.File, error) {
378378
}
379379
if w.context != nil && file == fmt.Sprintf("zruntime_defs_%s_%s.go", w.context.GOOS, w.context.GOARCH) {
380380
// Just enough to keep the api checker happy.
381-
src := "package runtime; type maptype struct{}; type _type struct{}; type alg struct{};" +
382-
" type mspan struct{}; type m struct{}; type lock struct{}; type slicetype struct{};" +
383-
" type iface struct{}; type eface struct{}; type interfacetype struct{}; type itab struct{};" +
384-
" type mcache struct{}; type bucket struct{}; type sudog struct{}; type g struct{}"
381+
src := "package runtime; type (" +
382+
" maptype struct{}; _type struct{}; alg struct{};" +
383+
" mspan struct{}; m struct{}; lock struct{}; slicetype struct{};" +
384+
" iface struct{}; eface struct{}; interfacetype struct{}; itab struct{};" +
385+
" mcache struct{}; bucket struct{}; sudog struct{}; g struct{};" +
386+
")"
385387
f, err = parser.ParseFile(fset, filename, src, 0)
386388
if err != nil {
387389
log.Fatalf("incorrect generated file: %s", err)

0 commit comments

Comments
 (0)