| // +build !nacl,!js,!android |
| // Copyright 2016 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| var tmpl = template.Must(template.New("main").Parse(` |
| func (t *T) Get{{.Name}}() string { |
| type Name struct{ Name string } |
| var t struct{ Names []Name } |
| t.Names = append(t.Names, Name{Name: fmt.Sprintf("H%06X", i)}) |
| if err := tmpl.Execute(buf, t); err != nil { |
| dir, err := ioutil.TempDir("", "issue16037-") |
| path := filepath.Join(dir, "ridiculous_number_of_fields.go") |
| if err := ioutil.WriteFile(path, buf.Bytes(), 0664); err != nil { |
| out, err := exec.Command("go", "build", "-o="+filepath.Join(dir, "out"), path).CombinedOutput() |
| log.Fatalf("build failed: %v\n%s", err, out) |