Skip to content

Commit

Permalink
Remove unused parameters
Browse files Browse the repository at this point in the history
Signed-off-by: James Pond <[email protected]>
  • Loading branch information
jamesponddotco committed Feb 13, 2024
1 parent 485b88e commit d0c7aea
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 119 deletions.
72 changes: 36 additions & 36 deletions aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestAWSService_List(t *testing.T) {
}{
{
name: "Valid AWS account data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(validTestData)
Expand Down Expand Up @@ -71,7 +71,7 @@ func TestAWSService_List(t *testing.T) {
},
{
name: "Invalid AWS account data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(invalidTestData)
Expand All @@ -82,7 +82,7 @@ func TestAWSService_List(t *testing.T) {
},
{
name: "API error response",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
},
context: ctx,
Expand All @@ -91,7 +91,7 @@ func TestAWSService_List(t *testing.T) {
},
{
name: "Empty AWS account data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(emptyTestData)
Expand All @@ -102,7 +102,7 @@ func TestAWSService_List(t *testing.T) {
},
{
name: "Nil context",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: nil,
want: nil,
wantErr: true,
Expand Down Expand Up @@ -156,7 +156,7 @@ func TestAWSService_Create(t *testing.T) {
}{
{
name: "Valid AWS account data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusCreated)

w.Write(validTestData)
Expand All @@ -182,7 +182,7 @@ func TestAWSService_Create(t *testing.T) {
},
{
name: "Invalid AWS account data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(invalidTestData)
Expand All @@ -198,7 +198,7 @@ func TestAWSService_Create(t *testing.T) {
},
{
name: "API error response",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusBadRequest)
},
context: ctx,
Expand All @@ -212,7 +212,7 @@ func TestAWSService_Create(t *testing.T) {
},
{
name: "Nil context",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
give: &cloudcraft.AWSAccount{
Name: "Go SDK Test",
RoleARN: "arn:aws:iam::643880554691j:role/cloudcraft",
Expand All @@ -223,15 +223,15 @@ func TestAWSService_Create(t *testing.T) {
},
{
name: "Nil AWS account",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
give: nil,
want: nil,
wantErr: true,
},
{
name: "Empty Name",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
give: &cloudcraft.AWSAccount{
Name: "",
Expand All @@ -243,7 +243,7 @@ func TestAWSService_Create(t *testing.T) {
},
{
name: "Empty RoleARN",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
give: &cloudcraft.AWSAccount{
Name: "Go SDK Test",
Expand Down Expand Up @@ -298,7 +298,7 @@ func TestAWSService_Update(t *testing.T) {
}{
{
name: "Valid AWS account data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusNoContent)
},
context: ctx,
Expand All @@ -320,7 +320,7 @@ func TestAWSService_Update(t *testing.T) {
},
{
name: "API error response",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusBadRequest)
},
context: ctx,
Expand All @@ -334,15 +334,15 @@ func TestAWSService_Update(t *testing.T) {
},
{
name: "Nil AWS account",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
give: nil,
want: nil,
wantErr: true,
},
{
name: "Nil context",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: nil,
give: &cloudcraft.AWSAccount{
ID: "fe3e5b29-a0e8-41ca-91e2-02a0441b1d33",
Expand All @@ -354,7 +354,7 @@ func TestAWSService_Update(t *testing.T) {
},
{
name: "Empty ID",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
give: &cloudcraft.AWSAccount{
Name: "My updated AWS account",
Expand All @@ -365,7 +365,7 @@ func TestAWSService_Update(t *testing.T) {
},
{
name: "Empty name",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
give: &cloudcraft.AWSAccount{
ID: "fe3e5b29-a0e8-41ca-91e2-02a0441b1d33",
Expand All @@ -376,7 +376,7 @@ func TestAWSService_Update(t *testing.T) {
},
{
name: "Empty role ARN",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
give: &cloudcraft.AWSAccount{
ID: "fe3e5b29-a0e8-41ca-91e2-02a0441b1d33",
Expand Down Expand Up @@ -430,7 +430,7 @@ func TestAWSService_Delete(t *testing.T) {
}{
{
name: "Valid AWS account data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusNoContent)
},
context: ctx,
Expand All @@ -448,7 +448,7 @@ func TestAWSService_Delete(t *testing.T) {
},
{
name: "API error response",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusBadRequest)
},
context: ctx,
Expand All @@ -458,15 +458,15 @@ func TestAWSService_Delete(t *testing.T) {
},
{
name: "Nil context",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: nil,
give: "fe3e5b29-a0e8-41ca-91e2-02a0441b1d33",
want: nil,
wantErr: true,
},
{
name: "Empty ID",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
give: "",
want: nil,
Expand Down Expand Up @@ -524,7 +524,7 @@ func TestAWSService_Snapshot(t *testing.T) {
}{
{
name: "Valid AWS account snapshot",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(validTestData)
Expand All @@ -543,7 +543,7 @@ func TestAWSService_Snapshot(t *testing.T) {
},
{
name: "API error response",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusBadRequest)
},
context: ctx,
Expand All @@ -558,7 +558,7 @@ func TestAWSService_Snapshot(t *testing.T) {
},
{
name: "Nil context",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: nil,
giveID: "fe3e5b29-a0e8-41ca-91e2-02a0441b1d33",
giveRegion: "us-east-1",
Expand All @@ -571,7 +571,7 @@ func TestAWSService_Snapshot(t *testing.T) {
},
{
name: "Nil snapshot params",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(validTestData)
Expand All @@ -587,7 +587,7 @@ func TestAWSService_Snapshot(t *testing.T) {
},
{
name: "Empty format",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(validTestData)
Expand All @@ -606,7 +606,7 @@ func TestAWSService_Snapshot(t *testing.T) {
},
{
name: "Empty ID",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
giveID: "",
giveRegion: "us-east-1",
Expand All @@ -619,7 +619,7 @@ func TestAWSService_Snapshot(t *testing.T) {
},
{
name: "Empty region",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: ctx,
giveID: "fe3e5b29-a0e8-41ca-91e2-02a0441b1d33",
giveRegion: "",
Expand Down Expand Up @@ -693,7 +693,7 @@ func TestAWSService_IAMParameters(t *testing.T) {
}{
{
name: "Valid IAM parameters data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(validTestData)
Expand All @@ -708,7 +708,7 @@ func TestAWSService_IAMParameters(t *testing.T) {
},
{
name: "Invalid IAM parameters data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(invalidTestData)
Expand All @@ -719,7 +719,7 @@ func TestAWSService_IAMParameters(t *testing.T) {
},
{
name: "Nil context",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: nil,
want: nil,
wantErr: true,
Expand Down Expand Up @@ -772,7 +772,7 @@ func TestAWSService_IAMPolicy(t *testing.T) {
}{
{
name: "Valid IAM policy data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(validTestData)
Expand Down Expand Up @@ -805,7 +805,7 @@ func TestAWSService_IAMPolicy(t *testing.T) {
},
{
name: "Invalid IAM policy data",
handler: func(w http.ResponseWriter, r *http.Request) {
handler: func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)

w.Write(invalidTestData)
Expand All @@ -816,7 +816,7 @@ func TestAWSService_IAMPolicy(t *testing.T) {
},
{
name: "Nil context",
handler: func(w http.ResponseWriter, r *http.Request) {},
handler: func(_ http.ResponseWriter, _ *http.Request) {},
context: nil,
want: nil,
wantErr: true,
Expand Down
Loading

0 comments on commit d0c7aea

Please sign in to comment.