style: Apply code formatting with go fmt

- Run 'make format' to ensure all Go code follows standard formatting
- Maintains consistent code style across the entire codebase
- No functional changes, only whitespace and formatting improvements
This commit is contained in:
Ole-Morten Duesund 2025-09-01 10:05:29 +02:00
commit 2bffa2c418
19 changed files with 543 additions and 527 deletions

View file

@ -21,15 +21,15 @@ func TestCallsignManager_ParseCallsign(t *testing.T) {
manager := NewCallsignManager(db.GetConnection())
testCases := []struct {
callsign string
expectedValid bool
expectedAirline string
expectedFlight string
callsign string
expectedValid bool
expectedAirline string
expectedFlight string
}{
{"UAL123", true, "UAL", "123"},
{"BA4567", true, "BA", "4567"},
{"AFR89", true, "AFR", "89"},
{"N123AB", false, "", ""}, // Aircraft registration, not callsign
{"N123AB", false, "", ""}, // Aircraft registration, not callsign
{"INVALID", false, "", ""}, // No numbers
{"123", false, "", ""}, // Only numbers
{"A", false, "", ""}, // Too short
@ -39,15 +39,15 @@ func TestCallsignManager_ParseCallsign(t *testing.T) {
for _, tc := range testCases {
result := manager.ParseCallsign(tc.callsign)
if result.IsValid != tc.expectedValid {
t.Errorf("ParseCallsign(%s): expected valid=%v, got %v",
t.Errorf("ParseCallsign(%s): expected valid=%v, got %v",
tc.callsign, tc.expectedValid, result.IsValid)
}
if result.IsValid && result.AirlineCode != tc.expectedAirline {
t.Errorf("ParseCallsign(%s): expected airline=%s, got %s",
t.Errorf("ParseCallsign(%s): expected airline=%s, got %s",
tc.callsign, tc.expectedAirline, result.AirlineCode)
}
if result.IsValid && result.FlightNumber != tc.expectedFlight {
t.Errorf("ParseCallsign(%s): expected flight=%s, got %s",
t.Errorf("ParseCallsign(%s): expected flight=%s, got %s",
tc.callsign, tc.expectedFlight, result.FlightNumber)
}
}
@ -101,7 +101,7 @@ func TestCallsignManager_GetCallsignInfo_InvalidCallsign(t *testing.T) {
defer cleanup()
manager := NewCallsignManager(db.GetConnection())
// Test with invalid callsign format
info, err := manager.GetCallsignInfo("INVALID")
if err != nil {
@ -129,7 +129,7 @@ func TestCallsignManager_GetCallsignInfo_EmptyCallsign(t *testing.T) {
defer cleanup()
manager := NewCallsignManager(db.GetConnection())
// Test with empty callsign
info, err := manager.GetCallsignInfo("")
if err == nil {
@ -162,7 +162,7 @@ func TestCallsignManager_GetCacheStats(t *testing.T) {
if err != nil {
t.Error("GetCacheStats should not error:", err)
}
if stats == nil {
t.Error("Expected cache stats, got nil")
}
@ -265,4 +265,4 @@ func TestCallsignParseResult_Struct(t *testing.T) {
if !result.IsValid {
t.Error("IsValid field not preserved")
}
}
}