{"repo":"go-simpler/sloglint","free":true,"listed":false,"github":"https://github.com/go-simpler/sloglint","clone":"git clone https://github.com/go-simpler/sloglint.git","description":"🪵 Ensure consistent code style when using log/slog","language":"Go","stars":265,"topics":["go","linter","logging","static-analysis","slog","tool"],"license":"MPL-2.0","category":"dev-tools","readme_excerpt":"sloglint A Go linter that ensures consistent code style when using log/slog . Install sloglint is part of golangci-lint, and this is the recommended way to use it. Alternatively, you can download a prebuilt binary from the Releases page to use sloglint standalone. Supported checks For log/slog functions: - No global logger - Context only - Discard handler For log messages: - Static message - Message style For log arguments: - No mixed arguments - Key-value pairs only - Attributes only - Arguments on separate lines For log keys: - Constant keys - Allowed keys - Forbidden keys - Key naming case The checks for log messages, arguments, and keys can also be used to analyze custom functions. No global logger Report the use of global loggers. Alternatively, only report the use of the slog.Default() logger. Context only Report the use of functions without a context.Context . Alternatively, only report their use if a context exists within the scope of the outermost function. This check partially supports autofix. Discard handler Suggest using slog.DiscardHandler when possible. This check is enabled by default and supports autofix. Static message Report dynamic log messages, such as those that are built with fmt.Sprintf . Message style Report log messages that do not match a particular style. The supported styles are lowercased (the first letter is lowercase) and capitalized (the first letter is uppercase). No mixed arguments Report the use of both key-value pairs and attributes within","default_branch":null,"files":null,"tree":[],"storefront":"/r/go-simpler","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/go-simpler/sloglint/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}