@@ -24,21 +24,21 @@ func ExampleGenerate() {
2424 // Two supported files: one Go, one Python. Both have a function
2525 // and a type declaration so the example exercises the AST and
2626 // regex paths.
27- if err := os .WriteFile (filepath .Join (dir , "main.go" ), []byte (`package main
27+ if writeErr := os .WriteFile (filepath .Join (dir , "main.go" ), []byte (`package main
2828
2929func main() {}
3030
3131type Server struct{}
32- ` ), 0o644 ); err != nil {
33- panic (err )
32+ ` ), 0o644 ); writeErr != nil {
33+ panic (writeErr )
3434 }
35- if err := os .WriteFile (filepath .Join (dir , "app.py" ), []byte (`class App:
35+ if writeErr := os .WriteFile (filepath .Join (dir , "app.py" ), []byte (`class App:
3636 pass
3737
3838def run():
3939 pass
40- ` ), 0o644 ); err != nil {
41- panic (err )
40+ ` ), 0o644 ); writeErr != nil {
41+ panic (writeErr )
4242 }
4343
4444 rm , err := Generate (dir , Options {MaxFiles : 100 , MaxTokens : 5000 })
@@ -60,21 +60,21 @@ def run():
6060func TestExampleGenerate_isRunnable (t * testing.T ) {
6161 dir := t .TempDir ()
6262
63- if err := os .WriteFile (filepath .Join (dir , "main.go" ), []byte (`package main
63+ if writeErr := os .WriteFile (filepath .Join (dir , "main.go" ), []byte (`package main
6464
6565func main() {}
6666
6767type Server struct{}
68- ` ), 0o644 ); err != nil {
69- t .Fatal (err )
68+ ` ), 0o644 ); writeErr != nil {
69+ t .Fatal (writeErr )
7070 }
71- if err := os .WriteFile (filepath .Join (dir , "app.py" ), []byte (`class App:
71+ if writeErr := os .WriteFile (filepath .Join (dir , "app.py" ), []byte (`class App:
7272 pass
7373
7474def run():
7575 pass
76- ` ), 0o644 ); err != nil {
77- t .Fatal (err )
76+ ` ), 0o644 ); writeErr != nil {
77+ t .Fatal (writeErr )
7878 }
7979
8080 rm , err := Generate (dir , Options {MaxFiles : 100 , MaxTokens : 5000 })
0 commit comments