Fix linter warnings (#4219)

This commit is contained in:
Johan Brandhorst-Satzkorn committed 2024-01-05 07:43:22 -08:00
1 parent 69262c386c
commit 1303f7c363
11 files changed
+31 -25

No files matched your search

+3 -1
View File
@@ -18,6 +18,8 @@ import (
"github.com/hashicorp/boundary/internal/errors"
"github.com/mitchellh/cli"
"github.com/posener/complete"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
var errDaemonNotRunning = stderr.New("The daemon process is not running.")
@@ -205,7 +207,7 @@ func printUsersTable(us []daemon.UserStatus) []string {
}
maxLength := base.MaxAttributesLength(nonAttributeMap, nil, nil)
ret = append(ret,
fmt.Sprintf(" %s:", strings.Title(r.Name)),
fmt.Sprintf(" %s:", cases.Title(language.English).String(r.Name)),
base.WrapMap(6, maxLength+6, nonAttributeMap),
)
}
@@ -17,7 +17,7 @@ import (
)
// stop will send a term signal to the daemon to shut down.
func (s *StopCommand) stop(ctx context.Context) error {
func (c *StopCommand) stop(ctx context.Context) error {
switch {
case util.IsNil(ctx):
return errors.New("Invalid parameter provided to stop: context is missing")
@@ -20,7 +20,7 @@ import (
)
// stop will send a term signal to the daemon to shut down.
func (s *StopCommand) stop(ctx context.Context) error {
func (c *StopCommand) stop(ctx context.Context) error {
switch {
case util.IsNil(ctx):
return errors.New("Invalid parameter provided to stop: context is missing")
@@ -40,7 +40,7 @@ func (s *StopCommand) stop(ctx context.Context) error {
} else if apiErr != nil {
errMsg = apiErr.Message
}
s.UI.Warn(fmt.Sprintf("Failed stopping the daemon through the handler: %q, now killing the process", errMsg))
c.UI.Warn(fmt.Sprintf("Failed stopping the daemon through the handler: %q, now killing the process", errMsg))
default:
// there wasn't an error stopping it through the handler. No need to
// force kill the process