Skip to content

Commit a97336c

Browse files
committed
fix: resolve linting and test issues
Changes: 1. Fixed gci formatting in session.go - proper tab indentation 2. Fixed gci formatting in session_test.go - added space before struct{ 3. Fixed fieldalignment in vals.go - reordered Options fields for optimal memory layout 4. Updated test expectation - changed default behavior test to expect secure default (no logging) All linting checks now pass (0 issues) All tests now pass (4/4 test suites passing) Signed-off-by: Aditya Menon <amenon@canarytechnologies.com>
1 parent 0c83d87 commit a97336c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

pkg/awsclicompat/session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func parseAWSLogLevel(defaultLevel string) aws.ClientLogMode {
5151
return aws.LogRetries | aws.LogRequest
5252
case "verbose":
5353
return aws.LogRetries | aws.LogRequest | aws.LogRequestWithBody |
54-
aws.LogResponse | aws.LogResponseWithBody | aws.LogSigning
54+
aws.LogResponse | aws.LogResponseWithBody | aws.LogSigning
5555
}
5656

5757
// Parse individual flags (comma-separated)

pkg/awsclicompat/session_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ func TestParseAWSLogLevel(t *testing.T) {
1414
expected aws.ClientLogMode
1515
}{
1616
{
17-
name: "empty environment variable defaults to retries and request",
17+
name: "empty environment variable defaults to no logging (secure default)",
1818
envValue: "",
19-
expected: aws.LogRetries | aws.LogRequest,
19+
expected: 0,
2020
},
2121
{
2222
name: "off disables all logging",
@@ -151,7 +151,7 @@ func TestDefaultSecureBehavior(t *testing.T) {
151151

152152
// TestPresetLevels tests the new preset log levels
153153
func TestPresetLevels(t *testing.T) {
154-
tests := []struct{
154+
tests := []struct {
155155
name string
156156
level string
157157
expected aws.ClientLogMode

vals.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,18 +531,18 @@ func IgnorePrefix(p string) Option {
531531
}
532532

533533
type Options struct {
534-
LogOutput io.Writer
535-
CacheSize int
536-
ExcludeSecret bool
537-
FailOnMissingKeyInMap bool
534+
LogOutput io.Writer
538535
// AWSLogLevel controls AWS SDK logging. Valid values:
539536
// - "off" or "" (default): No AWS SDK logging
540537
// - "minimal": Log only retries
541538
// - "standard": Log retries and requests (previous default)
542539
// - "verbose": Log everything (requests, responses, signing)
543540
// - Custom: Comma-separated values (e.g., "request,response")
544541
// This is overridden by AWS_SDK_GO_LOG_LEVEL environment variable if set
545-
AWSLogLevel string
542+
AWSLogLevel string
543+
CacheSize int
544+
ExcludeSecret bool
545+
FailOnMissingKeyInMap bool
546546
}
547547

548548
var unsafeCharRegexp = regexp.MustCompile(`[^\w@%+=:,./-]`)

0 commit comments

Comments
 (0)