Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ linters:
- '-QF1003' # disable rule 'Convert if/else-if chain to tagged switch'
- '-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'
# https://golangci-lint.run/usage/linters/#staticcheck
# https://staticcheck.dev/docs/configuration/options/#initialisms
initialisms:
Expand Down
2 changes: 1 addition & 1 deletion internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (c *Client) auths(ctx context.Context) (map[string]types.SlackAuth, error)
if err != nil {
return auths, err
}
var path string = filepath.Join(dir, credentialsFileName)
var path = filepath.Join(dir, credentialsFileName)

if _, err := c.fs.Stat(path); os.IsNotExist(err) {
return auths, err
Expand Down
8 changes: 4 additions & 4 deletions internal/config/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (c *SystemConfig) UserConfig(ctx context.Context) (*SystemConfig, error) {
if err != nil {
return &SystemConfig{}, err
}
var path string = filepath.Join(dir, configFileName)
var path = filepath.Join(dir, configFileName)

if _, err := c.fs.Stat(path); os.IsNotExist(err) {
return &config, err
Expand Down Expand Up @@ -424,7 +424,7 @@ func (c *SystemConfig) initializeConfigFiles(ctx context.Context, dir string) er
defer span.Finish()

// ensure the credentials.json file exists
var credentialsPath string = filepath.Join(dir, credentialsFileName)
var credentialsPath = filepath.Join(dir, credentialsFileName)
_, err := c.fs.Stat(credentialsPath)
if os.IsNotExist(err) {
// create the credentials file because it does not exist
Expand All @@ -435,7 +435,7 @@ func (c *SystemConfig) initializeConfigFiles(ctx context.Context, dir string) er
}

// ensure the config.json file exists
var configPath string = filepath.Join(dir, configFileName)
var configPath = filepath.Join(dir, configFileName)
_, err = c.fs.Stat(configPath)
if os.IsNotExist(err) {
err = c.writeConfigFile(configPath, []byte("{}\n"))
Expand All @@ -445,7 +445,7 @@ func (c *SystemConfig) initializeConfigFiles(ctx context.Context, dir string) er
}

// ensure the logs folder exists
var logsPath string = filepath.Join(dir, logsFolderName)
var logsPath = filepath.Join(dir, logsFolderName)
_, err = c.fs.Stat(logsPath)
if os.IsNotExist(err) {
// create the logs folder because it does not exist
Expand Down
6 changes: 3 additions & 3 deletions internal/iostreams/logfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (io *IOStreams) InitLogFile(ctx context.Context) error {
}()

// Ensure the error log file exists
var errorLogFilePath string = filepath.Join(logFolder, filename)
var errorLogFilePath = filepath.Join(logFolder, filename)

// TODO: this os reference should probably be something that is dependency injected for easier testing
errorLogFile, err := os.OpenFile(errorLogFilePath, permissions, 0600)
Expand Down Expand Up @@ -99,7 +99,7 @@ func (io *IOStreams) FlushToLogFile(ctx context.Context, prefix, errStr string)
}

// Ensure the error log file exists
var errorLogFilePath string = filepath.Join(logFolder, filename)
var errorLogFilePath = filepath.Join(logFolder, filename)

errorLogFile, err := io.fs.OpenFile(errorLogFilePath, permissions, 0600)
if err != nil {
Expand All @@ -126,7 +126,7 @@ func (io *IOStreams) FinishLogFile(ctx context.Context) {
logFolder, _ := io.config.SystemConfig.LogsDir(ctx)

// Ensure the error log file exists
var errorLogFilePath string = filepath.Join(logFolder, filename)
var errorLogFilePath = filepath.Join(logFolder, filename)

// TODO: this os reference should probably be something that is dependency injected for easier testing
errorLogFile, err := os.OpenFile(errorLogFilePath, permissions, 0600)
Expand Down
2 changes: 1 addition & 1 deletion internal/iostreams/survey.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func (io *IOStreams) retrieveFlagValue(flagset []*pflag.Flag) (*pflag.Flag, erro
func errInteractivityFlags(cfg PromptConfig) error {
flags := cfg.GetFlags()
var remediation string
var helpMessage string = "Learn more about this command with `--help`"
var helpMessage = "Learn more about this command with `--help`"

if len(flags) == 1 {
remediation = fmt.Sprintf("Try running the command with the `--%s` flag included", flags[0].Name)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/auth/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func saveNewAuth(ctx context.Context, apiClient api.APIInterface, authClient aut
}

// Write to credentials json if serviceTokenFlag is false
var filePath string = ""
var filePath = ""
if !noRotation {
_, credentialsLocation, err := authClient.SetAuth(ctx, newAuth)
if err != nil {
Expand Down
Loading