]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/api: reduce stutter in runtime type stubs
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 21 Aug 2014 17:16:49 +0000 (10:16 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 21 Aug 2014 17:16:49 +0000 (10:16 -0700)
LGTM=khr
R=khr
CC=dvyukov, golang-codereviews
https://golang.org/cl/132770044

src/cmd/api/goapi.go

index d7b16a0c4ff5e85012c7122877bfeb0d40bead39..07f007fdfb182184a9dc96e5d80a63e63c473536 100644 (file)
@@ -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)