Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
aripalo committed May 12, 2022
1 parent ef09ffb commit 7dc4d57
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/app/assume.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (a *App) Assume(flags AssumeFlags) error {
// Catch timeout error and return a cleaner error message.
if err != nil {
if errors.Is(err, context.DeadlineExceeded) {
msg.Fatal(fmt.Sprintf("Operation Timeout"))
msg.Fatal("Operation Timeout")
}
msg.Fatal(fmt.Sprintf("Credentials: STS: %s", err))
}
Expand Down
2 changes: 1 addition & 1 deletion internal/app/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestVersion(t *testing.T) {
a := &App{dest: &output}
err := a.Version(test.input)
require.NoError(t, err)
actual := string(output.Bytes())
actual := output.String()
assert.Equal(t, test.expected, actual)
})
}
Expand Down
6 changes: 2 additions & 4 deletions internal/multinput/multinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package multinput

import (
"context"
"time"
)

// Identifier for a single resolver.
Expand All @@ -17,7 +16,6 @@ type Result struct {

// Multinput models the configuration/state.
type Multinput struct {
timeout time.Duration
results chan *Result
resolvers []InputResolver
}
Expand All @@ -33,8 +31,8 @@ func New(resolvers []InputResolver) Multinput {
}
}

// Provide runs the given resolvers and will keep waitig for first
// non-empty value until timeout reached.
// Provide runs the given resolvers and will keep waiting for first
// non-empty value until timeout (defined by ctx) reached.
func (m *Multinput) Provide(ctx context.Context) (*Result, error) {

// loop through all given resolvers, run them as goroutines and
Expand Down
2 changes: 1 addition & 1 deletion internal/tmpl/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestWrite(t *testing.T) {
t.Run(name, func(t *testing.T) {
var output bytes.Buffer
err := Write(&output, "test", test.template, test.input)
actual := string(output.Bytes())
actual := output.String()
assert.Equal(t, test.err, err)
assert.Equal(t, test.expected, actual)
})
Expand Down
2 changes: 1 addition & 1 deletion internal/totp/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ func formatInputMessage(enableGui bool, enableYubikey bool) string {
if err != nil {
msg.Fatal(err.Error())
}
return string(message.Bytes())
return message.String()
}
2 changes: 2 additions & 0 deletions internal/totp/totp.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ func GetCode(ctx context.Context, options Options) (string, error) {

code := result.Value

msg.Debug("ℹ️", fmt.Sprintf("MFA: Token received: \"%s\"", result.Value))

if !isValidToken(code) {
return code, errors.New("invalid mfa code") // TODO
}
Expand Down

0 comments on commit 7dc4d57

Please sign in to comment.