66 "crypto/rsa"
77 "errors"
88 "fmt"
9- "io/ioutil"
109 "os"
1110 "regexp"
1211 "strings"
@@ -198,7 +197,7 @@ func parseConfigFile(data []byte, profile string) (info *configFileInfo, err err
198197
199198 //Look for profile
200199 for i , line := range splitContent {
201- if match := profileRegex .FindStringSubmatch (line ); match != nil && len (match ) > 1 && match [1 ] == profile {
200+ if match := profileRegex .FindStringSubmatch (line ); len (match ) > 1 && match [1 ] == profile {
202201 start := i + 1
203202 return parseConfigAtLine (start , splitContent )
204203 }
@@ -257,7 +256,7 @@ func openConfigFile(configFilePath string) (data []byte, err error) {
257256 return
258257 }
259258
260- data , err = ioutil .ReadFile (expandedPath )
259+ data , err = os .ReadFile (expandedPath )
261260 if err != nil {
262261 err = fmt .Errorf ("can not read config file: %s due to: %s" , configFilePath , err .Error ())
263262 }
@@ -272,7 +271,7 @@ func readTokenFromFile(tokenFilePath string) (string, error) {
272271 return "" , err
273272 }
274273
275- data , err := ioutil .ReadFile (expandedPath )
274+ data , err := os .ReadFile (expandedPath )
276275 if err != nil {
277276 err = fmt .Errorf ("can not read token file: %s due to: %s" , tokenFilePath , err .Error ())
278277 return "" , err
@@ -404,7 +403,7 @@ func (p fileConfigurationProvider) PrivateRSAKey() (key *rsa.PrivateKey, err err
404403 return
405404 }
406405
407- pemFileContent , err := ioutil .ReadFile (expandedPath )
406+ pemFileContent , err := os .ReadFile (expandedPath )
408407 if err != nil {
409408 err = fmt .Errorf ("can not read PrivateKey %s from configuration file due to: %s" , filePath , err .Error ())
410409 return
@@ -439,7 +438,7 @@ func (p fileConfigurationProvider) Region() (value string, err error) {
439438 return canStringBeRegion (value )
440439}
441440
442- var blankRegex = regexp .MustCompile (" \\ s" )
441+ var blankRegex = regexp .MustCompile (`\s` )
443442
444443func canStringBeRegion (stringRegion string ) (region string , err error ) {
445444 if blankRegex .MatchString (stringRegion ) || stringRegion == "" {
0 commit comments