Fix some lint and vet issues

This commit is contained in:
Pim van Pelt
2025-08-28 21:17:37 +02:00
parent 7b3639ad69
commit 105a245239
10 changed files with 47 additions and 41 deletions

View File

@@ -9,7 +9,7 @@ import (
func TestGenerateEnv(t *testing.T) {
tmpDir := t.TempDir()
// Create test directories
testLogDir := filepath.Join(tmpDir, "test-log")
testLog2Dir := filepath.Join(tmpDir, "test-log-2")
@@ -25,11 +25,11 @@ func TestGenerateEnv(t *testing.T) {
// Create test roots files
rootsFile := filepath.Join(tmpDir, "roots.pem")
extraRootsFile := filepath.Join(tmpDir, "extra-roots.pem")
rootsContent := `-----BEGIN CERTIFICATE-----
MIIBkTCB+wIJAKZJ...
-----END CERTIFICATE-----`
extraRootsContent := `-----BEGIN CERTIFICATE-----
MIIBkTCB+wIJAKZK...
-----END CERTIFICATE-----`
@@ -80,7 +80,7 @@ logs:
}
envStr := string(envContent)
// Check TESSERACT_ARGS contains expected values
if !strings.Contains(envStr, "TESSERACT_ARGS=") {
t.Error("Expected TESSERACT_ARGS in .env file")
@@ -199,7 +199,7 @@ func TestCreateCombinedRootsPemWithStatus(t *testing.T) {
func TestGenerateEnvMissingDirectory(t *testing.T) {
tmpDir := t.TempDir()
// Create config with non-existent directory
configContent := `logs:
- shortname: "test-log"
@@ -216,4 +216,4 @@ func TestGenerateEnvMissingDirectory(t *testing.T) {
// Should call log.Fatalf which exits the program
// We can't easily test this without subprocess, so we'll skip it
t.Skip("Cannot easily test log.Fatalf without subprocess")
}
}