From 0cfdc5d6741f29f3a60f2f97de6d5b5aa67e6d16 Mon Sep 17 00:00:00 2001
From: Somtochi Onyekwere <somtochionyekwere@gmail.com>
Date: Tue, 2 Aug 2022 19:46:19 +0100
Subject: [PATCH] move struct definition

Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
---
 cmd/flux/logs.go      |  1 -
 cmd/flux/logs_test.go | 22 +++++++++++-----------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/cmd/flux/logs.go b/cmd/flux/logs.go
index ff00a913..c9f78239 100644
--- a/cmd/flux/logs.go
+++ b/cmd/flux/logs.go
@@ -277,7 +277,6 @@ func logRequest(ctx context.Context, request rest.ResponseWrapper, w io.Writer)
 }
 
 func filterPrintLog(t *template.Template, l *ControllerLogEntry, w io.Writer) {
-	//fmt.
 	if (logsArgs.logLevel == "" || logsArgs.logLevel == l.Level) &&
 		(logsArgs.kind == "" || strings.EqualFold(logsArgs.kind, l.Kind)) &&
 		(logsArgs.name == "" || strings.EqualFold(logsArgs.name, l.Name)) &&
diff --git a/cmd/flux/logs_test.go b/cmd/flux/logs_test.go
index 88a61dfe..4e495370 100644
--- a/cmd/flux/logs_test.go
+++ b/cmd/flux/logs_test.go
@@ -94,17 +94,6 @@ var testPodLogs = `{"level":"info","ts":"2022-08-02T12:55:34.419Z","logger":"con
 {"level":"info","ts":"2022-08-02T12:56:34.961Z","logger":"controller.gitrepository","msg":"no changes since last reconcilation: observed revision","reconciler group":"source.toolkit.fluxcd.io","reconciler kind":"GitRepository","name":"podinfo","namespace":"default"}
 {"level":"error","ts":"2022-08-02T12:56:34.961Z","logger":"controller.kustomization","msg":"no changes since last reconcilation: observed revision","reconciler group":"kustomize.toolkit.fluxcd.io","reconciler kind":"Kustomization","name":"podinfo","namespace":"flux-system"}`
 
-type testResponseMapper struct {
-}
-
-func (t *testResponseMapper) DoRaw(_ context.Context) ([]byte, error) {
-	return nil, nil
-}
-
-func (t *testResponseMapper) Stream(_ context.Context) (io.ReadCloser, error) {
-	return io.NopCloser(strings.NewReader(testPodLogs)), nil
-}
-
 func TestLogRequest(t *testing.T) {
 	mapper := &testResponseMapper{}
 	tests := []struct {
@@ -189,3 +178,14 @@ func TestLogRequest(t *testing.T) {
 		})
 	}
 }
+
+type testResponseMapper struct {
+}
+
+func (t *testResponseMapper) DoRaw(_ context.Context) ([]byte, error) {
+	return nil, nil
+}
+
+func (t *testResponseMapper) Stream(_ context.Context) (io.ReadCloser, error) {
+	return io.NopCloser(strings.NewReader(testPodLogs)), nil
+}
-- 
GitLab