diff options
author | Jake Champlin <jake@gnu.space> | 2017-06-09 17:54:32 +0000 |
---|---|---|
committer | Jake Champlin <jake@gnu.space> | 2017-06-09 17:54:32 +0000 |
commit | 9b12e4fe6f3c95986f1f3ec791636c58ca7e7583 (patch) | |
tree | 38f5f12bec0e488a12f0459a7356e6b7de7d8f84 /vendor/github.com/aws/aws-sdk-go/internal | |
parent | cec3de8a3bcaffd21dedd1bf42da4b490cae7e16 (diff) | |
download | terraform-provider-statuscake-9b12e4fe6f3c95986f1f3ec791636c58ca7e7583.tar.gz terraform-provider-statuscake-9b12e4fe6f3c95986f1f3ec791636c58ca7e7583.tar.zst terraform-provider-statuscake-9b12e4fe6f3c95986f1f3ec791636c58ca7e7583.zip |
Transfer of provider code
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/internal')
-rw-r--r-- | vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go new file mode 100644 index 0000000..ebcbc2b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go | |||
@@ -0,0 +1,40 @@ | |||
1 | package shareddefaults | ||
2 | |||
3 | import ( | ||
4 | "os" | ||
5 | "path/filepath" | ||
6 | "runtime" | ||
7 | ) | ||
8 | |||
9 | // SharedCredentialsFilename returns the SDK's default file path | ||
10 | // for the shared credentials file. | ||
11 | // | ||
12 | // Builds the shared config file path based on the OS's platform. | ||
13 | // | ||
14 | // - Linux/Unix: $HOME/.aws/credentials | ||
15 | // - Windows: %USERPROFILE%\.aws\credentials | ||
16 | func SharedCredentialsFilename() string { | ||
17 | return filepath.Join(UserHomeDir(), ".aws", "credentials") | ||
18 | } | ||
19 | |||
20 | // SharedConfigFilename returns the SDK's default file path for | ||
21 | // the shared config file. | ||
22 | // | ||
23 | // Builds the shared config file path based on the OS's platform. | ||
24 | // | ||
25 | // - Linux/Unix: $HOME/.aws/config | ||
26 | // - Windows: %USERPROFILE%\.aws\config | ||
27 | func SharedConfigFilename() string { | ||
28 | return filepath.Join(UserHomeDir(), ".aws", "config") | ||
29 | } | ||
30 | |||
31 | // UserHomeDir returns the home directory for the user the process is | ||
32 | // running under. | ||
33 | func UserHomeDir() string { | ||
34 | if runtime.GOOS == "windows" { // Windows | ||
35 | return os.Getenv("USERPROFILE") | ||
36 | } | ||
37 | |||
38 | // *nix | ||
39 | return os.Getenv("HOME") | ||
40 | } | ||