diff --git a/.golangci.yml b/.golangci.yml index db9f0fcc..1d9acd9c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -40,7 +40,6 @@ linters: - '-QF1004' # disable rule 'Use strings.ReplaceAll instead of strings.Replace' - '-QF1008' # disable rule 'Omit embedded fields from selector' - '-QF1011' # disable rule 'Omit redundant type from variable declaration' - - '-ST1016' # disable rule 'Use consistent method receiver names' # https://golangci-lint.run/usage/linters/#staticcheck # https://staticcheck.dev/docs/configuration/options/#initialisms initialisms: diff --git a/internal/iostreams/iostreams_mock.go b/internal/iostreams/iostreams_mock.go index 5a86e96b..6b548009 100644 --- a/internal/iostreams/iostreams_mock.go +++ b/internal/iostreams/iostreams_mock.go @@ -98,13 +98,13 @@ func (m *IOStreamsMock) IsTTY() bool { } // SetExitCode sets the desired exit code in a thread-safe way -func (io *IOStreamsMock) SetExitCode(code ExitCode) { - atomic.StoreInt32((*int32)(&io.exitCode), int32(code)) +func (m *IOStreamsMock) SetExitCode(code ExitCode) { + atomic.StoreInt32((*int32)(&m.exitCode), int32(code)) } // GetExitCode returns the most-recently set desired exit code in a thread safe way -func (io *IOStreamsMock) GetExitCode() ExitCode { - return ExitCode(atomic.LoadInt32((*int32)(&io.exitCode))) +func (m *IOStreamsMock) GetExitCode() ExitCode { + return ExitCode(atomic.LoadInt32((*int32)(&m.exitCode))) } // InitLogFile mocks starting the debug info to diff --git a/internal/prompts/app_select.go b/internal/prompts/app_select.go index 6620c620..86717639 100644 --- a/internal/prompts/app_select.go +++ b/internal/prompts/app_select.go @@ -129,20 +129,20 @@ func (apps *TeamApps) IsEmpty() bool { // Basically, treat as a convenience getter intended for use in the context where // you have a team you want to filter against and you don't care whether it's an // auth or an app that corresponds. E.g. when you are comparing to --team flags -func (t *TeamApps) authOrAppTeamDomain() string { - if t.Auth.TeamDomain != "" && (t.Auth.TeamID == t.Hosted.App.TeamID || t.Auth.TeamID == t.Local.App.TeamID) { +func (apps *TeamApps) authOrAppTeamDomain() string { + if apps.Auth.TeamDomain != "" && (apps.Auth.TeamID == apps.Hosted.App.TeamID || apps.Auth.TeamID == apps.Local.App.TeamID) { // Auth whose team id matches either hosted or local app's team // Can be safely returned - return t.Auth.TeamDomain + return apps.Auth.TeamDomain } // If we get here we might be missing an auth OR the auth doesn't // match any included app team ids (that is the case when the auth is org // resolved for a workspace app) - if t.Hosted.App.TeamID != "" { - return t.Hosted.App.TeamDomain + if apps.Hosted.App.TeamID != "" { + return apps.Hosted.App.TeamDomain } - return t.Local.App.TeamDomain + return apps.Local.App.TeamDomain } // authOrAppTeamID greedily returns a team ID corresponding to the TeamApps @@ -157,14 +157,14 @@ func (t *TeamApps) authOrAppTeamDomain() string { // Basically, treat as a convenience getter intended for use in the context where // you have a team you want to filter against and you don't care whether it's an // auth or an app that corresponds. E.g. when you are comparing to --team flags -func (t *TeamApps) authOrAppTeamID() string { - if t.Auth.TeamID != "" && (t.Hosted.App.TeamID == t.Auth.TeamID || t.Local.App.TeamID == t.Auth.TeamID) { - return t.Auth.TeamID +func (apps *TeamApps) authOrAppTeamID() string { + if apps.Auth.TeamID != "" && (apps.Hosted.App.TeamID == apps.Auth.TeamID || apps.Local.App.TeamID == apps.Auth.TeamID) { + return apps.Auth.TeamID } - if t.Hosted.App.TeamID != "" { - return t.Hosted.App.TeamID + if apps.Hosted.App.TeamID != "" { + return apps.Hosted.App.TeamID } - return t.Local.App.TeamID + return apps.Local.App.TeamID } // appTransferDisclaimer contains a notice of lost app management permissions diff --git a/internal/slackdeps/os.go b/internal/slackdeps/os.go index 8362bff8..a9ab366b 100644 --- a/internal/slackdeps/os.go +++ b/internal/slackdeps/os.go @@ -85,11 +85,11 @@ func (c *Os) Glob(pattern string) (matches []string, err error) { } // Exit exits the program with a return code -func (m *Os) Exit(code int) { +func (c *Os) Exit(code int) { os.Exit(code) } // Stdout returns the file descriptor for stdout -func (m *Os) Stdout() types.File { +func (c *Os) Stdout() types.File { return os.Stdout }