Skip to content

Commit 899b110

Browse files
committed
fix: resolve shadowed variable issue in literate.go
correct variable name to avoid shadowing and potential errors in file reading process. Updated 'path' to 'fullPath' for clarity and accuracy.
1 parent 06c0575 commit 899b110

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/book/utils/litgo/literate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ func (l Literate) Process(input *plugin.Input) error {
5757
chapterDir: chapterDir,
5858
bookSrcDir: bookSrcDir,
5959
}
60-
path := pathInfo.FullPath()
60+
fullPath := pathInfo.FullPath()
6161

6262
// TODO(directxman12): don't escape root?
63-
contents, err := os.ReadFile(path)
63+
contents, err := os.ReadFile(fullPath)
6464
if err != nil {
65-
return "", fmt.Errorf("unable to import %q: %v", path, err)
65+
return "", fmt.Errorf("unable to import %q: %v", fullPath, err)
6666
}
6767

6868
return l.extractContents(contents, pathInfo)

0 commit comments

Comments
 (0)