diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-17 18:38:14 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-17 18:38:14 -0400 |
commit | 0f85e72d1331b49b52925d6cc5ad083a0376104c (patch) | |
tree | 9ba66e893d6f66096f6b06284d09c8eb3e50facc /lib/textui | |
parent | c0f33186aa7a8903c5e7406024f13fad48cd14e3 (diff) | |
parent | 1ea26f04701fa66e36b058f3efb3a6c7059cdc5c (diff) |
Merge branch 'lukeshu/lint'
Diffstat (limited to 'lib/textui')
-rw-r--r-- | lib/textui/log.go | 10 | ||||
-rw-r--r-- | lib/textui/text.go | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/textui/log.go b/lib/textui/log.go index 0a10ef6..9aff364 100644 --- a/lib/textui/log.go +++ b/lib/textui/log.go @@ -35,9 +35,9 @@ type LogLevelFlag struct { var _ pflag.Value = (*LogLevelFlag)(nil) // Type implements pflag.Value. -func (lvl *LogLevelFlag) Type() string { return "loglevel" } +func (*LogLevelFlag) Type() string { return "loglevel" } -// Type implements pflag.Value. +// Set implements pflag.Value. func (lvl *LogLevelFlag) Set(str string) error { switch strings.ToLower(str) { case "error": @@ -56,7 +56,7 @@ func (lvl *LogLevelFlag) Set(str string) error { return nil } -// Type implements pflag.Value. +// String implements fmt.Stringer (and pflag.Value). func (lvl *LogLevelFlag) String() string { switch lvl.Level { case dlog.LogLevelError: @@ -94,7 +94,7 @@ func NewLogger(out io.Writer, lvl dlog.LogLevel) dlog.Logger { } // Helper implements dlog.Logger. -func (l *logger) Helper() {} +func (*logger) Helper() {} // WithField implements dlog.Logger. func (l *logger) WithField(key string, value any) dlog.Logger { @@ -127,7 +127,7 @@ func (l *logger) StdLogger(lvl dlog.LogLevel) *log.Logger { } // Log implements dlog.Logger. -func (l *logger) Log(lvl dlog.LogLevel, msg string) { +func (*logger) Log(dlog.LogLevel, string) { panic("should not happen: optimized log methods should be used instead") } diff --git a/lib/textui/text.go b/lib/textui/text.go index c0a3c5e..538bac2 100644 --- a/lib/textui/text.go +++ b/lib/textui/text.go @@ -2,6 +2,8 @@ // // SPDX-License-Identifier: GPL-2.0-or-later +// Package textui implements utilities for emitting human-friendly +// text on stdout and stderr. package textui import ( |