feat(tests): Fixing linter problems

Using golangci-lint
This commit is contained in:
2025-06-04 14:29:13 +02:00
parent d77029b597
commit def5d097a4
13 changed files with 195 additions and 49 deletions

13
utils/hash_test.go Normal file
View File

@@ -0,0 +1,13 @@
package utils
import "testing"
func TestHash(t *testing.T) {
h, err := HashComposefiles([]string{"./hash.go"})
if err != nil {
t.Fatalf("failed to hash compose files: %v", err)
}
if len(h) == 0 {
t.Fatal("hash should not be empty")
}
}

View File

@@ -165,7 +165,9 @@ func Confirm(question string, icon ...Icon) bool {
fmt.Print(question + " [y/N] ")
}
var response string
fmt.Scanln(&response)
if _, err := fmt.Scanln(&response); err != nil {
log.Fatalf("Error parsing response: %s", err.Error())
}
return strings.ToLower(response) == "y"
}