Skip to content

Commit 7377d36

Browse files
authored
Merge branch 'main' into feat/poam-phase1
2 parents 5131d85 + 68a5b9f commit 7377d36

File tree

7 files changed

+8
-32
lines changed

7 files changed

+8
-32
lines changed

cmd/dashboards/export.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ func exportDashboards(cmd *cobra.Command, args []string) {
3535
}
3636
sugar := zapLogger.Sugar()
3737
defer func() {
38-
err := zapLogger.Sync() // flushes buffer, if any
39-
if err != nil {
40-
sugar.Error("failed to flush sync buffer", "err", err)
41-
}
38+
_ = zapLogger.Sync() // Flushes buffer, if any. We ignore errors here (that are commonly-seen) as distracting and not of note.
4239
}()
4340

4441
config := config.NewConfig(sugar)

cmd/dashboards/import.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ func importDashboards(cmd *cobra.Command, args []string) {
4141
}
4242
sugar := zapLogger.Sugar()
4343
defer func() {
44-
err := zapLogger.Sync()
45-
if err != nil {
46-
sugar.Error("failed to flush sync buffer", "err", err)
47-
}
44+
_ = zapLogger.Sync() // Flushes buffer, if any. We ignore errors here (that are commonly-seen) as distracting and not of note.
4845
}()
4946

5047
cfg := config.NewConfig(sugar)

cmd/migrate.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ func migrateUp(cmd *cobra.Command, args []string) {
5050
}
5151
sugar := zapLogger.Sugar()
5252
defer func() {
53-
err := zapLogger.Sync()
54-
if err != nil {
55-
sugar.Error("failed to sync zap logger", "error", err)
56-
}
53+
_ = zapLogger.Sync() // Flushes buffer, if any. We ignore errors here (that are commonly-seen) as distracting and not of note.
5754
}()
5855

5956
cfg := config.NewConfig(sugar)
@@ -76,10 +73,7 @@ func migrateDown(cmd *cobra.Command, args []string) {
7673
}
7774
sugar := zapLogger.Sugar()
7875
defer func() {
79-
err := zapLogger.Sync()
80-
if err != nil {
81-
sugar.Error("failed to sync zap logger", "error", err)
82-
}
76+
_ = zapLogger.Sync() // Flushes buffer, if any. We ignore errors here (that are commonly-seen) as distracting and not of note.
8377
}()
8478

8579
cfg := config.NewConfig(sugar)

cmd/oscal/export.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ func exportOscal(cmd *cobra.Command, args []string) {
3838
}
3939
sugar := zapLogger.Sugar()
4040
defer func() {
41-
err := zapLogger.Sync()
42-
if err != nil {
43-
log.Println("failed to sync logger:", err)
44-
}
41+
_ = zapLogger.Sync() // Flushes buffer, if any. We ignore errors here (that are commonly-seen) as distracting and not of note.
4542
}()
4643

4744
config := config.NewConfig(sugar)

cmd/oscal/import.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ func importOscal(cmd *cobra.Command, args []string) {
4646
}
4747
sugar := zapLogger.Sugar()
4848
defer func() {
49-
err := zapLogger.Sync()
50-
if err != nil {
51-
sugar.Error("failed to sync zap logger", "error", err)
52-
}
49+
_ = zapLogger.Sync() // Flushes buffer, if any. We ignore errors here (that are commonly-seen) as distracting and not of note.
5350
}()
5451

5552
config := config.NewConfig(sugar)

cmd/seed/evidence.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ func generateEvidence(cmd *cobra.Command, args []string) {
5959
}
6060
sugar := zapLogger.Sugar()
6161
defer func() {
62-
err := zapLogger.Sync()
63-
if err != nil {
64-
log.Println("failed to sync logger:", err)
65-
}
62+
_ = zapLogger.Sync() // Flushes buffer, if any. We ignore errors here (that are commonly-seen) as distracting and not of note.
6663
}()
6764

6865
cmdConfig := config.NewConfig(sugar)

cmd/seed/heartbeat.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ func generateHeartbeats(cmd *cobra.Command, args []string) {
5353
}
5454
sugar := zapLogger.Sugar()
5555
defer func() {
56-
err := zapLogger.Sync()
57-
if err != nil {
58-
log.Println("failed to sync logger:", err)
59-
}
56+
_ = zapLogger.Sync() // Flushes buffer, if any. We ignore errors here (that are commonly-seen) as distracting and not of note.
6057
}()
6158

6259
cmdConfig := config.NewConfig(sugar)

0 commit comments

Comments
 (0)