Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
run:
timeout: 5m

linters:
enable:
- errcheck
- govet
- ineffassign
- staticcheck
- unused
Comment on lines +4 to +10
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config enables a few linters, but without linters.disable-all: true golangci-lint will also run its default-enabled linters (which can change between golangci-lint versions). If the intent is to run only the listed conservative set, add disable-all: true and keep the explicit enable list.

Copilot uses AI. Check for mistakes.
disable:
- depguard

linters-settings:
errcheck:
check-type-assertions: false

issues:
exclude-use-default: true
max-issues-per-linter: 50
max-same-issues: 10
4 changes: 2 additions & 2 deletions ops/downloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ func findRemoteTarballByVersion(version, flavor, OS, arch string, minimal, newes

tarball, err = downloads.FindOrGuessTarballByVersionFlavorOS(version, flavor, OS, arch, minimal, newest, guessLatest)
if err != nil {
return downloads.TarballDescription{}, fmt.Errorf(fmt.Sprintf("Error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",
version, flavor, OS, minimal, newest, guessLatest, err))
return downloads.TarballDescription{}, fmt.Errorf("Error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The returned error string is capitalized ("Error getting version...") and the original error is interpolated with %s, which loses error wrapping. Prefer a lower-case error message and wrap the underlying error (so callers can use errors.Is/As).

Suggested change
return downloads.TarballDescription{}, fmt.Errorf("Error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",
return downloads.TarballDescription{}, fmt.Errorf("error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %w",

Copilot uses AI. Check for mistakes.
version, flavor, OS, minimal, newest, guessLatest, err)
}
return tarball, nil
}
Expand Down
8 changes: 6 additions & 2 deletions ts/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ func findErrorsInLogFile(ts *testscript.TestScript, neg bool, args []string) {
ts.Check(err)
hasError := strings.Contains(string(contents), "ERROR")
if neg && hasError {
reLines := regexp.MustCompile(`(?sg)(^.*ERROR.*)`)
reLines := regexp.MustCompile(`(?m)(^.*ERROR.*$)`)
errorLines := reLines.FindAll(contents, -1)
ts.Fatalf("ERRORs found in %s (%s)\n", logFile, errorLines)
var lines []string
for _, line := range errorLines {
lines = append(lines, string(line))
}
ts.Fatalf("ERRORs found in %s (%s)\n", logFile, strings.Join(lines, "\n"))
}
if !neg && !hasError {
ts.Fatalf("ERRORs not found in %s\n", logFile)
Expand Down
Loading