Skip to content

Commit

Permalink
Formatting code: gofumpt -w -extra .
Browse files Browse the repository at this point in the history
  • Loading branch information
monde committed Jul 12, 2024
1 parent 8fb1fe0 commit 8a249d2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/root/profileslist/profiles-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package profileslist

import (
"fmt"

"github.com/spf13/cobra"

"github.com/okta/okta-aws-cli/internal/config"
Expand All @@ -37,7 +38,6 @@ func NewProfilesListCommand() *cobra.Command {
fmt.Println("Profiles:")

keys, err := config.ReadConfigProfileKeys()

if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package root

import (
"fmt"
"github.com/okta/okta-aws-cli/cmd/root/profileslist"
"os"
"path/filepath"

"github.com/okta/okta-aws-cli/cmd/root/profileslist"

"github.com/spf13/cobra"

debugCmd "github.com/okta/okta-aws-cli/cmd/root/debug"
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ func NewConfig(attrs *Attributes) (*Config, error) {
return cfg, nil
}

func getFlagNameFromProfile(awsProfile string, flag string) string {
func getFlagNameFromProfile(awsProfile, flag string) string {
profileKey := fmt.Sprintf("%s.%s", awsProfile, flag)
if awsProfile != "" && viper.IsSet(profileKey) && viper.Get(profileKey) != "" {
// NOTE: If the flag was from a multiple profiles keyed by aws profile
Expand Down
10 changes: 5 additions & 5 deletions internal/output/aws_credentials_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
)

// ensureConfigExists verify that the config file exists
func ensureConfigExists(filename string, profile string) error {
func ensureConfigExists(filename, profile string) error {
if _, err := os.Stat(filename); err != nil {
if errors.Is(err, os.ErrNotExist) {
dir := filepath.Dir(filename)
Expand All @@ -65,7 +65,7 @@ func ensureConfigExists(filename string, profile string) error {
return nil
}

func saveProfile(filename, profile string, cfc *oaws.CredsFileCredential, legacyVars, expiryVars bool, expiry string, regionVar string) error {
func saveProfile(filename, profile string, cfc *oaws.CredsFileCredential, legacyVars, expiryVars bool, expiry, regionVar string) error {
config, err := updateConfig(filename, profile, cfc, legacyVars, expiryVars, expiry, regionVar)
if err != nil {
return err
Expand All @@ -80,7 +80,7 @@ func saveProfile(filename, profile string, cfc *oaws.CredsFileCredential, legacy
return nil
}

func updateConfig(filename, profile string, cfc *oaws.CredsFileCredential, legacyVars, expiryVars bool, expiry string, region string) (config *ini.File, err error) {
func updateConfig(filename, profile string, cfc *oaws.CredsFileCredential, legacyVars, expiryVars bool, expiry, region string) (config *ini.File, err error) {
config, err = ini.Load(filename)
if err != nil {
return
Expand Down Expand Up @@ -131,7 +131,7 @@ func updateConfig(filename, profile string, cfc *oaws.CredsFileCredential, legac

// updateIni will comment out any keys that are not "aws_access_key_id",
// "aws_secret_access_key", "aws_session_token", "credential_process"
func updateINI(config *ini.File, profile string, legacyVars bool, expiryVars bool, region string) (*ini.File, error) {
func updateINI(config *ini.File, profile string, legacyVars, expiryVars bool, region string) (*ini.File, error) {
ignore := []string{
"aws_access_key_id",
"aws_secret_access_key",
Expand Down Expand Up @@ -184,7 +184,7 @@ type AWSCredentialsFile struct {
}

// NewAWSCredentialsFile Creates a new
func NewAWSCredentialsFile(legacyVars bool, expiryVars bool, expiry string) *AWSCredentialsFile {
func NewAWSCredentialsFile(legacyVars, expiryVars bool, expiry string) *AWSCredentialsFile {
return &AWSCredentialsFile{
LegacyAWSVariables: legacyVars,
ExpiryAWSVariables: expiryVars,
Expand Down
2 changes: 1 addition & 1 deletion internal/paginator/paginator.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Paginator struct {
}

// NewPaginator Paginator constructor
func NewPaginator(httpClient *http.Client, url *url.URL, headers *map[string]string, params *map[string]string) *Paginator {
func NewPaginator(httpClient *http.Client, url *url.URL, headers, params *map[string]string) *Paginator {
pgntr := Paginator{
httpClient: httpClient,
url: url,
Expand Down

0 comments on commit 8a249d2

Please sign in to comment.