Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions test/utils/func.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,14 @@
versionDir := filepath.Join(projectDir, "bin", "func-cli", version)
funcBinary := filepath.Join(versionDir, "func")

// Check if already cached
if _, err := os.Stat(funcBinary); err == nil {
return funcBinary, nil
// Check if already cached and executable
if info, err := os.Stat(funcBinary); err == nil {
isExecutable := info.Mode().Perm()&0o111 != 0
if isExecutable {
return funcBinary, nil
}
// Binary exists but is not executable — remove and re-download
os.Remove(funcBinary)

Check failure on line 197 in test/utils/func.go

View workflow job for this annotation

GitHub Actions / Lint

Error return value of `os.Remove` is not checked (errcheck)
}

// Download the version
Expand Down
Loading