Skip to content

Commit 4e9ec76

Browse files
hi-leiclaude
andcommitted
fix: satisfy gosec G304 with filepath.Clean in version cache
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1102973 commit 4e9ec76

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/verda-cli/cmd/util/versionhint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func VersionCachePath() (string, error) {
4444
// LoadVersionCache reads the version cache from disk.
4545
// Returns an empty cache (no error) if the file is missing or corrupt.
4646
func LoadVersionCache(path string) (*VersionCache, error) {
47-
data, err := os.ReadFile(path)
47+
data, err := os.ReadFile(filepath.Clean(path))
4848
if err != nil {
4949
// Missing file is not an error — just return empty cache.
5050
return &VersionCache{}, nil //nolint:nilerr // intentional: missing file → empty cache

0 commit comments

Comments
 (0)