Skip to content

Commit 7355f0a

Browse files
committed
Fix some gas warnings
1 parent 230d286 commit 7355f0a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

analyzer.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ func (gas *Analyzer) Process(packagePaths ...string) error {
102102
AllowErrors: true,
103103
}
104104
for _, packagePath := range packagePaths {
105-
abspath, _ := filepath.Abs(packagePath)
105+
abspath, err := filepath.Abs(packagePath)
106+
if err != nil {
107+
return err
108+
}
106109
gas.logger.Println("Searching directory:", abspath)
107110

108111
basePackage, err := build.Default.ImportDir(packagePath, build.ImportComment)

issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func codeSnippet(file *os.File, start int64, end int64, n ast.Node) (string, err
7676
}
7777

7878
size := (int)(end - start) // Go bug, os.File.Read should return int64 ...
79-
file.Seek(start, 0)
79+
file.Seek(start, 0) // #nosec
8080

8181
buf := make([]byte, size)
8282
if nread, err := file.Read(buf); err != nil || nread != size {

0 commit comments

Comments
 (0)