Skip to content

Commit

Permalink
Resolving formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
harshitap26 committed Feb 13, 2025
1 parent 3d95583 commit bf3b245
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ func TestGet(t *testing.T) {
defer ts.Close()

c, err := New(ts.URL, ClientOptions{
Timeout: 10 * time.Second}, true)
Timeout: 10 * time.Second}, true)

Check failure on line 637 in api/api_test.go

View workflow job for this annotation

GitHub Actions / Golang Validation / Lint golang code

File is not properly formatted (gofumpt)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -722,24 +722,24 @@ func TestPost(t *testing.T) {
}

func TestPut(t *testing.T) {
tests := []struct{
name string
path string
headers map[string]string
resp interface{}
body interface{}
expectedErr error
tests := []struct {
name string
path string
headers map[string]string
resp interface{}
body interface{}
expectedErr error
expectedBody string
} {
}{
{
name: "Successful Put Request",
path: "/api/test",
headers: map[string]string{
"content-type": "application/json",
},
resp: nil,
body: nil,
expectedErr: nil,
resp: nil,
body: nil,
expectedErr: nil,
expectedBody: `{"message":"Success"}`,
},
}
Expand Down Expand Up @@ -788,7 +788,6 @@ func TestPut(t *testing.T) {
}
}


func TestDelete(t *testing.T) {
tests := []struct {
name string
Expand Down Expand Up @@ -858,7 +857,6 @@ func TestDelete(t *testing.T) {
}
}


func TestDoMethod(t *testing.T) {
tests := []struct {
name string
Expand Down Expand Up @@ -912,7 +910,7 @@ func TestDoMethod(t *testing.T) {
t.Fatal(err)
}

err = c.Do(context.Background(), http.MethodGet,tt.path, tt.headers, &tt.resp)
err = c.Do(context.Background(), http.MethodGet, tt.path, tt.headers, &tt.resp)
if !errors.Is(err, tt.expectedErr) {
t.Errorf("expected error %v, got %v", tt.expectedErr, err)
}
Expand Down

0 comments on commit bf3b245

Please sign in to comment.