@@ -8,14 +8,14 @@ import (
8
8
"io"
9
9
"io/ioutil"
10
10
"os"
11
- "os/user"
12
11
"path/filepath"
13
12
"strings"
14
13
"time"
15
14
16
15
"github.com/aws/aws-sdk-go-v2/aws"
17
16
"github.com/aws/aws-sdk-go-v2/feature/ec2/imds"
18
17
"github.com/aws/aws-sdk-go-v2/internal/ini"
18
+ "github.com/aws/aws-sdk-go-v2/internal/shareddefaults"
19
19
"github.com/aws/smithy-go/logging"
20
20
)
21
21
@@ -108,7 +108,7 @@ var defaultSharedConfigProfile = DefaultSharedConfigProfile
108
108
// - Linux/Unix: $HOME/.aws/credentials
109
109
// - Windows: %USERPROFILE%\.aws\credentials
110
110
func DefaultSharedCredentialsFilename () string {
111
- return filepath .Join (userHomeDir (), ".aws" , "credentials" )
111
+ return filepath .Join (shareddefaults . UserHomeDir (), ".aws" , "credentials" )
112
112
}
113
113
114
114
// DefaultSharedConfigFilename returns the SDK's default file path for
@@ -119,7 +119,7 @@ func DefaultSharedCredentialsFilename() string {
119
119
// - Linux/Unix: $HOME/.aws/config
120
120
// - Windows: %USERPROFILE%\.aws\config
121
121
func DefaultSharedConfigFilename () string {
122
- return filepath .Join (userHomeDir (), ".aws" , "config" )
122
+ return filepath .Join (shareddefaults . UserHomeDir (), ".aws" , "config" )
123
123
}
124
124
125
125
// DefaultSharedConfigFiles is a slice of the default shared config files that
@@ -1268,22 +1268,6 @@ func (e CredentialRequiresARNError) Error() string {
1268
1268
)
1269
1269
}
1270
1270
1271
- func userHomeDir () string {
1272
- // Ignore errors since we only care about Windows and *nix.
1273
- home , _ := os .UserHomeDir ()
1274
-
1275
- if len (home ) > 0 {
1276
- return home
1277
- }
1278
-
1279
- currUser , _ := user .Current ()
1280
- if currUser != nil {
1281
- home = currUser .HomeDir
1282
- }
1283
-
1284
- return home
1285
- }
1286
-
1287
1271
func oneOrNone (bs ... bool ) bool {
1288
1272
var count int
1289
1273
0 commit comments