Skip to content

Commit 1e0b7dd

Browse files
committed
Eliminate global logger calls
1 parent f9378f1 commit 1e0b7dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ linters-settings:
209209
# - "default": report only the default slog logger
210210
# https://github.com/go-simpler/sloglint?tab=readme-ov-file#no-global
211211
# Default: ""
212-
no-global: ""
212+
no-global: "all"
213213
# Enforce using methods that accept a context.
214214
# Values:
215215
# - "": disabled

examples/vehiclestats/vehiclestats.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919
flag.Parse()
2020

2121
if *filename == "" {
22-
slog.Error("no filename provided (--file)")
22+
logger.Error("no filename provided (--file)")
2323
os.Exit(1)
2424
}
2525

@@ -36,7 +36,7 @@ func main() {
3636
// Create a [roadtrip.Vehicle] object with contents from a Road Trip data file.
3737
vehicle, err := roadtrip.NewVehicleFromFile(*filename, options)
3838
if err != nil {
39-
slog.Error("unable to load Road Trip data file",
39+
logger.Error("unable to load Road Trip data file",
4040
"error", err,
4141
)
4242
os.Exit(1)

0 commit comments

Comments
 (0)