chore: add golangci-lint v2 config and fix linter warnings (#46)

- [x] Add golangci-lint v2 configuration with formatters section
- [x] Reorganize linters-settings under linters section
- [x] Replace if-else chains with switch statements for clarity
- [x] Wrap all ignored error returns with `_ = ` pattern
- [x] Add OSC 8 hyperlink helper function for clickable ports
- [x] Add blank line in table styling function
- [x] Remove unnecessary type assertion in test
This commit is contained in:
2026-02-13 18:46:27 +00:00
committed by GitHub
parent d3c5e5eb36
commit e50f73ec92
17 changed files with 65 additions and 47 deletions
+3 -3
View File
@@ -98,13 +98,13 @@ func (l *Logger) log(level Level, msg string, fields map[string]interface{}) {
Fields: fields,
}
data, _ := json.Marshal(entry)
fmt.Fprintln(l.output, string(data))
_, _ = fmt.Fprintln(l.output, string(data))
} else {
// Text format
if len(fields) > 0 {
fmt.Fprintf(l.output, "[%s] %s %v\n", levelStr, msg, fields)
_, _ = fmt.Fprintf(l.output, "[%s] %s %v\n", levelStr, msg, fields)
} else {
fmt.Fprintf(l.output, "[%s] %s\n", levelStr, msg)
_, _ = fmt.Fprintf(l.output, "[%s] %s\n", levelStr, msg)
}
}
}