From 8f592f3442619e3c02b3fbd562cc88b7c3b7ef53 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Thu, 19 May 2016 12:26:02 -0400 Subject: [PATCH] Don't use pointers to int64 in function calls when not necessary --- builtin/logical/aws/path_sts.go | 4 ++-- builtin/logical/aws/secret_access_keys.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/builtin/logical/aws/path_sts.go b/builtin/logical/aws/path_sts.go index 58103cccc..5d69e157b 100644 --- a/builtin/logical/aws/path_sts.go +++ b/builtin/logical/aws/path_sts.go @@ -52,7 +52,7 @@ func (b *backend) pathSTSRead( return b.assumeRole( req.Storage, req.DisplayName, policyName, policyValue, - &ttl, + ttl, ) } else { return logical.ErrorResponse( @@ -64,7 +64,7 @@ func (b *backend) pathSTSRead( return b.secretTokenCreate( req.Storage, req.DisplayName, policyName, policyValue, - &ttl, + ttl, ) } diff --git a/builtin/logical/aws/secret_access_keys.go b/builtin/logical/aws/secret_access_keys.go index 7e25eaa7b..0c8c3da8a 100644 --- a/builtin/logical/aws/secret_access_keys.go +++ b/builtin/logical/aws/secret_access_keys.go @@ -71,7 +71,7 @@ func genUsername(displayName, policyName, userType string) (ret string, warning func (b *backend) secretTokenCreate(s logical.Storage, displayName, policyName, policy string, - lifeTimeInSeconds *int64) (*logical.Response, error) { + lifeTimeInSeconds int64) (*logical.Response, error) { STSClient, err := clientSTS(s) if err != nil { return logical.ErrorResponse(err.Error()), nil @@ -83,7 +83,7 @@ func (b *backend) secretTokenCreate(s logical.Storage, &sts.GetFederationTokenInput{ Name: aws.String(username), Policy: aws.String(policy), - DurationSeconds: lifeTimeInSeconds, + DurationSeconds: &lifeTimeInSeconds, }) if err != nil { @@ -113,7 +113,7 @@ func (b *backend) secretTokenCreate(s logical.Storage, func (b *backend) assumeRole(s logical.Storage, displayName, policyName, policy string, - lifeTimeInSeconds *int64) (*logical.Response, error) { + lifeTimeInSeconds int64) (*logical.Response, error) { STSClient, err := clientSTS(s) if err != nil { return logical.ErrorResponse(err.Error()), nil @@ -125,7 +125,7 @@ func (b *backend) assumeRole(s logical.Storage, &sts.AssumeRoleInput{ RoleSessionName: aws.String(username), RoleArn: aws.String(policy), - DurationSeconds: lifeTimeInSeconds, + DurationSeconds: &lifeTimeInSeconds, }) if err != nil {