*: import reformats
As caused by my IntelliJ/gofmt locally. We really need to do gofmt
checks in CI, especially now that we nearly have the tooling ready for
it.
Change-Id: Id105ba9ad8a34b8b8e883d52d621d47b0ea888d7
Reviewed-on: https://review.monogon.dev/c/monogon/+/338
Reviewed-by: Lorenz Brun <lorenz@monogon.tech>
diff --git a/metropolis/pkg/logtree/klog.go b/metropolis/pkg/logtree/klog.go
index 3dd040e..07185ed 100644
--- a/metropolis/pkg/logtree/klog.go
+++ b/metropolis/pkg/logtree/klog.go
@@ -20,10 +20,11 @@
"fmt"
"io"
"regexp"
- "source.monogon.dev/metropolis/pkg/logbuffer"
"strconv"
"strings"
"time"
+
+ "source.monogon.dev/metropolis/pkg/logbuffer"
)
// KLogParser returns an io.WriteCloser to which raw logging from a klog emitter
diff --git a/metropolis/pkg/logtree/klog_test.go b/metropolis/pkg/logtree/klog_test.go
index f163f16..d53df3f 100644
--- a/metropolis/pkg/logtree/klog_test.go
+++ b/metropolis/pkg/logtree/klog_test.go
@@ -31,47 +31,47 @@
// Sat 01 Jan 2000 12:00:01 AM UTC
nowNewYear := time.Unix(946684801, 0)
- for i, te := range []struct{
- now time.Time
+ for i, te := range []struct {
+ now time.Time
line string
want *LeveledPayload
}{
// 0: Simple case: everything should parse correctly.
- { now, "E0312 14:20:04.240540 204 shared_informer.go:247] Caches are synced for attach detach", &LeveledPayload{
- messages: []string{"Caches are synced for attach detach"},
+ {now, "E0312 14:20:04.240540 204 shared_informer.go:247] Caches are synced for attach detach", &LeveledPayload{
+ messages: []string{"Caches are synced for attach detach"},
timestamp: time.Date(2021, 03, 12, 14, 20, 4, 240540000, time.UTC),
- severity: ERROR,
- file: "shared_informer.go",
- line: 247,
- } },
+ severity: ERROR,
+ file: "shared_informer.go",
+ line: 247,
+ }},
// 1: Mumbling line, should fail.
- { now, "Application starting up...", nil},
+ {now, "Application starting up...", nil},
// 2: Empty line, should fail.
- { now, "", nil},
+ {now, "", nil},
// 3: Line from the future, should fail.
- { now, "I1224 14:20:04.240540 204 john_titor.go:247] I'm sorry, what day is it today? Uuuh, and what year?", nil },
+ {now, "I1224 14:20:04.240540 204 john_titor.go:247] I'm sorry, what day is it today? Uuuh, and what year?", nil},
// 4: Log-across-year edge case. The log was emitted right before a year
// rollover, and parsed right after it. It should be attributed to the
// previous year.
- { nowNewYear, "I1231 23:59:43.123456 123 fry.go:123] Here's to another lousy millenium!", &LeveledPayload{
- messages: []string{"Here's to another lousy millenium!"},
+ {nowNewYear, "I1231 23:59:43.123456 123 fry.go:123] Here's to another lousy millenium!", &LeveledPayload{
+ messages: []string{"Here's to another lousy millenium!"},
timestamp: time.Date(1999, 12, 31, 23, 59, 43, 123456000, time.UTC),
- severity: INFO,
- file: "fry.go",
- line: 123,
+ severity: INFO,
+ file: "fry.go",
+ line: 123,
}},
// 5: Invalid severity, should fail.
- { now, "D0312 14:20:04.240540 204 shared_informer.go:247] Caches are synced for attach detach", nil },
+ {now, "D0312 14:20:04.240540 204 shared_informer.go:247] Caches are synced for attach detach", nil},
// 6: Invalid time, should fail.
- { now, "D0312 25:20:04.240540 204 shared_informer.go:247] Caches are synced for attach detach", nil },
+ {now, "D0312 25:20:04.240540 204 shared_informer.go:247] Caches are synced for attach detach", nil},
// 7: Simple case without sub-second timing: everything should parse correctly
- { now, "E0312 14:20:04 204 shared_informer.go:247] Caches are synced for attach detach", &LeveledPayload{
- messages: []string{"Caches are synced for attach detach"},
+ {now, "E0312 14:20:04 204 shared_informer.go:247] Caches are synced for attach detach", &LeveledPayload{
+ messages: []string{"Caches are synced for attach detach"},
timestamp: time.Date(2021, 03, 12, 14, 20, 4, 0, time.UTC),
- severity: ERROR,
- file: "shared_informer.go",
- line: 247,
- } },
+ severity: ERROR,
+ file: "shared_informer.go",
+ line: 247,
+ }},
} {
got := parse(te.now, te.line)
if diff := cmp.Diff(te.want, got, cmp.AllowUnexported(LeveledPayload{})); diff != "" {
@@ -79,4 +79,3 @@
}
}
}
-
diff --git a/metropolis/pkg/supervisor/supervisor_support.go b/metropolis/pkg/supervisor/supervisor_support.go
index 5f69104..699ea18 100644
--- a/metropolis/pkg/supervisor/supervisor_support.go
+++ b/metropolis/pkg/supervisor/supervisor_support.go
@@ -24,9 +24,9 @@
"net"
"os/exec"
- "source.monogon.dev/metropolis/pkg/logtree"
-
"google.golang.org/grpc"
+
+ "source.monogon.dev/metropolis/pkg/logtree"
)
// GRPCServer creates a Runnable that serves gRPC requests as longs as it's not