ceph-csi/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go
dependabot[bot] 2cc1a276fc rebase: bump github.com/aws/aws-sdk-go from 1.44.117 to 1.44.122
Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.117 to 1.44.122.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.117...v1.44.122)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 14:22:29 +00:00

47 lines
1.0 KiB
Go

package shareddefaults
import (
"os/user"
"path/filepath"
)
// SharedCredentialsFilename returns the SDK's default file path
// for the shared credentials file.
//
// Builds the shared config file path based on the OS's platform.
//
// - Linux/Unix: $HOME/.aws/credentials
// - Windows: %USERPROFILE%\.aws\credentials
func SharedCredentialsFilename() string {
return filepath.Join(UserHomeDir(), ".aws", "credentials")
}
// SharedConfigFilename returns the SDK's default file path for
// the shared config file.
//
// Builds the shared config file path based on the OS's platform.
//
// - Linux/Unix: $HOME/.aws/config
// - Windows: %USERPROFILE%\.aws\config
func SharedConfigFilename() string {
return filepath.Join(UserHomeDir(), ".aws", "config")
}
// UserHomeDir returns the home directory for the user the process is
// running under.
func UserHomeDir() string {
var home string
home = userHomeDir()
if len(home) > 0 {
return home
}
currUser, _ := user.Current()
if currUser != nil {
home = currUser.HomeDir
}
return home
}