Skip to content

Commit

Permalink
fixing lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nickzelei committed Nov 8, 2023
1 parent 13746c6 commit 033154b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 18 deletions.
3 changes: 2 additions & 1 deletion cli/internal/auth/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package auth
import (
"context"
"fmt"
"log/slog"
"net/http"
"net/url"
"time"
Expand Down Expand Up @@ -51,7 +52,7 @@ func getToken(ctx context.Context) (string, error) {
if err != nil {
return "", err
}
fmt.Println("access token is no longer valid. attempting to refresh...")
slog.Info("access token is no longer valid. attempting to refresh...")
refreshtoken, err := userconfig.GetRefreshToken()
if err != nil {
return "", err
Expand Down
6 changes: 3 additions & 3 deletions cli/internal/cmds/neosync/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"log/slog"
"net/http"
"net/url"
"time"
Expand Down Expand Up @@ -40,7 +41,7 @@ func login(ctx context.Context) error {
return err
}
if !authEnabledResp.Msg.IsEnabled {
fmt.Println("auth is not enabled server-side, exiting")
slog.Info("auth is not enabled server-side, exiting")
return nil
}
return oAuthLogin(ctx, authclient)
Expand Down Expand Up @@ -93,7 +94,7 @@ func oAuthLogin(
}()

if err := webbrowser.Open(authorizeurlResp.Msg.Url); err != nil {
fmt.Println("There was an issue opening the web browser, proceed to the following url to finish logging in to Neosync:\n", authorizeurlResp.Msg.Url)
fmt.Println("There was an issue opening the web browser, proceed to the following url to finish logging in to Neosync:\n", authorizeurlResp.Msg.Url) //nolint
}

select {
Expand All @@ -119,7 +120,6 @@ func oAuthLogin(
if err != nil {
return err
}
fmt.Println("write file success!")
if loginResp.Msg.AccessToken.RefreshToken != nil {
err = userconfig.SetRefreshToken(*loginResp.Msg.AccessToken.RefreshToken)
if err != nil {
Expand Down
16 changes: 8 additions & 8 deletions cli/internal/cmds/neosync/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ func NewCmd() *cobra.Command {
if err != nil {
return err
}
fmt.Println(string(marshaled))
fmt.Println(string(marshaled)) //nolint
} else if output == "yaml" {
marshaled, err := yaml.Marshal(&versionInfo)
if err != nil {
return err
}
fmt.Println(string(marshaled))
fmt.Println(string(marshaled)) //nolint
} else {
fmt.Println("Git Version:", versionInfo.GitVersion)
fmt.Println("Git Commit:", versionInfo.GitCommit)
fmt.Println("Build Date:", versionInfo.BuildDate)
fmt.Println("Go Version:", versionInfo.GoVersion)
fmt.Println("Compiler:", versionInfo.Compiler)
fmt.Println("Platform:", versionInfo.Platform)
fmt.Println("Git Version:", versionInfo.GitVersion) //nolint
fmt.Println("Git Commit:", versionInfo.GitCommit) //nolint
fmt.Println("Build Date:", versionInfo.BuildDate) //nolint
fmt.Println("Go Version:", versionInfo.GoVersion) //nolint
fmt.Println("Compiler:", versionInfo.Compiler) //nolint
fmt.Println("Platform:", versionInfo.Platform) //nolint
}
return nil
},
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/cmds/neosync/whoami/whoami.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ func whoami(ctx context.Context) error {
return err
}
// todo: layer in account data and access/id token information for even more goodness
fmt.Println("UserId:", resp.Msg.UserId)
fmt.Println("UserId:", resp.Msg.UserId) // nolint
return nil
}
4 changes: 2 additions & 2 deletions cli/internal/connect/interceptors/auth/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package auth_interceptor
import (
"context"
"errors"
"fmt"
"log/slog"

"connectrpc.com/connect"
)
Expand Down Expand Up @@ -44,7 +44,7 @@ func (i *Interceptor) WrapStreamingClient(next connect.StreamingClientFunc) conn
if err != nil {
err2 := conn.CloseRequest()
if err2 != nil {
fmt.Println(err2) // todo
slog.Info(err2.Error()) // todo
}
return conn
}
Expand Down
3 changes: 0 additions & 3 deletions worker/internal/benthos/transformers/phone_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package neosync_transformers

import (
"fmt"
"strings"
"testing"

Expand Down Expand Up @@ -60,8 +59,6 @@ func TestGeneratePhoneNumberPreserveLengthFalseIncludeHyphensTrue(t *testing.T)

res, err := GenerateRandomPhoneNumberWithHyphens()

fmt.Println("res", res)

assert.NoError(t, err)
assert.Equal(t, len(res), expectedLength, "The length of the output phone number should be the same as the input phone number")

Expand Down

0 comments on commit 033154b

Please sign in to comment.