Skip to content

Commit

Permalink
golint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
skotambkar committed Nov 2, 2020
1 parent a562721 commit 245ebac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions service/internal/s3shared/arn_lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ type InitARNLookupMiddleware struct {
GetARNValue func(interface{}) (*string, bool)
}

// ID for the middleware
func (m *InitARNLookupMiddleware) ID() string {
return "S3Shared:InitARNLookupMiddleware"
}

// HandleInitialize handles the behavior of this initialize step
func (m *InitARNLookupMiddleware) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
Expand Down
1 change: 1 addition & 0 deletions service/internal/s3shared/endpoint_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func NewClientConfiguredForDualStackError(resource arn.Resource, clientPartition
}
}

// SprintError returns a formatted error message string
func SprintError(code, message, extra string, origErr error) string {
msg := code + " : " + message
if extra != "" {
Expand Down
4 changes: 2 additions & 2 deletions service/internal/s3shared/resource_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn"
)

// ResourceRequest represents an ARN resource and api request metadata
type ResourceRequest struct {
Resource arn.Resource
// RequestRegion is the region configured on the request config
Expand All @@ -28,7 +29,7 @@ func (r ResourceRequest) ARN() awsarn.ARN {
return r.Resource.GetARN()
}

// UseFIPS returns true if request config region is FIPS region.
// UseFips returns true if request config region is FIPS region.
func (r ResourceRequest) UseFips() bool {
return IsFIPS(r.RequestRegion)
}
Expand Down Expand Up @@ -66,7 +67,6 @@ func (r ResourceRequest) IsCrossRegion() bool {
return !strings.EqualFold(v, r.Resource.GetARN().Region)
}

// TODO: should this be moved in aws endpoints package
// IsFIPS returns true if region is a fips region
func IsFIPS(clientRegion string) bool {
return (strings.HasPrefix(clientRegion, "fips-") ||
Expand Down
2 changes: 1 addition & 1 deletion service/s3/internal/arn/arn_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn"
)

// Used by shapes with members decorated as endpoint ARN.
// ParseEndpointARN parses a given generic aws ARN into a s3 arn resource.
func ParseEndpointARN(v awsarn.ARN) (arn.Resource, error) {
return arn.ParseResource(v, accessPointResourceParser)
}
Expand Down

0 comments on commit 245ebac

Please sign in to comment.