From 2ee7091933d2c07338dfb4699ce5665951b47afd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 16 Mar 2023 18:38:11 -0400 Subject: tree-wide: Ensure that all packages have a doc comment --- lib/textui/text.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/textui') 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 ( -- cgit v1.2.3-2-g168b From e082cfb3b8f8226067078cc410e4997fd1cf14df Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 16 Mar 2023 18:45:45 -0400 Subject: tree-wide: Ensure that all existing method doc comments follow the expected format --- lib/textui/log.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/textui') diff --git a/lib/textui/log.go b/lib/textui/log.go index 0a10ef6..6cf9abe 100644 --- a/lib/textui/log.go +++ b/lib/textui/log.go @@ -37,7 +37,7 @@ var _ pflag.Value = (*LogLevelFlag)(nil) // Type implements pflag.Value. func (lvl *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: -- cgit v1.2.3-2-g168b From 1ea26f04701fa66e36b058f3efb3a6c7059cdc5c Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 17 Mar 2023 02:28:54 -0400 Subject: tree-wide: Turn on all revive linters (with exceptions) --- lib/textui/log.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/textui') diff --git a/lib/textui/log.go b/lib/textui/log.go index 6cf9abe..9aff364 100644 --- a/lib/textui/log.go +++ b/lib/textui/log.go @@ -35,7 +35,7 @@ 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" } // Set implements pflag.Value. func (lvl *LogLevelFlag) Set(str string) error { @@ -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") } -- cgit v1.2.3-2-g168b