Skip to content

Commit 4ff3182

Browse files
committed
fix(repomap): rename shadowed err in doc_test.go to writeErr (lint)
1 parent f6ffbe7 commit 4ff3182

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

‎internal/intelligence/repomap/doc_test.go‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
2929
func main() {}
3030
3131
type 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
3838
def 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():
6060
func 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
6565
func main() {}
6666
6767
type 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
7474
def 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

Comments
 (0)