Skip to content

Commit

Permalink
fix(lint): use proper code style
Browse files Browse the repository at this point in the history
  • Loading branch information
h2non committed Mar 16, 2017
1 parent 8df2b95 commit 00768d4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion _examples/headers/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"

"gopkg.in/h2non/gentleman.v1"
"gopkg.in/h2non/gentleman.v1/plugins/headers"
)
Expand All @@ -11,7 +12,7 @@ func main() {
cli := gentleman.New()

// Define a global header at client level
cli.SetHeader("Version", "1.0"))
cli.SetHeader("Version", "1.0")

// Define a custom header (via headers plugin)
cli.Use(headers.Set("API-Token", "s3cr3t"))
Expand Down
7 changes: 4 additions & 3 deletions plugins/body/body.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"bytes"
"encoding/json"
"encoding/xml"
c "gopkg.in/h2non/gentleman.v1/context"
p "gopkg.in/h2non/gentleman.v1/plugin"
"gopkg.in/h2non/gentleman.v1/utils"
"io"
"io/ioutil"
"strings"

c "gopkg.in/h2non/gentleman.v1/context"
p "gopkg.in/h2non/gentleman.v1/plugin"
"gopkg.in/h2non/gentleman.v1/utils"
)

// String defines the HTTP request body based on the given string.
Expand Down
4 changes: 2 additions & 2 deletions plugins/multipart/multipart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestFiles(t *testing.T) {
func TestFields(t *testing.T) {
ctx := context.New()
fn := newHandler()
fields := map[string]Values{"foo": Values{"data=bar"}, "bar": Values{"data=baz"}}
fields := map[string]Values{"foo": {"data=bar"}, "bar": {"data=baz"}}

Fields(fields).Exec("request", ctx, fn.fn)
st.Expect(t, fn.called, true)
Expand All @@ -61,7 +61,7 @@ func TestData(t *testing.T) {
ctx := context.New()
fn := newHandler()
reader := bytes.NewReader([]byte("hello world"))
fields := map[string]Values{"foo": Values{"data=bar"}, "bar": Values{"data=baz"}}
fields := map[string]Values{"foo": {"data=bar"}, "bar": {"data=baz"}}
data := FormData{
Files: []FormFile{{Name: "foo", Reader: reader}},
Data: fields,
Expand Down
4 changes: 2 additions & 2 deletions request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ func TestRequestXML(t *testing.T) {
func TestRequestForm(t *testing.T) {
reader := bytes.NewReader([]byte("hello world"))
fields := map[string]multipart.Values{
"foo": multipart.Values{"data=bar"},
"bar": multipart.Values{"data=baz"},
"foo": {"data=bar"},
"bar": {"data=baz"},
}
data := multipart.FormData{
Files: []multipart.FormFile{{Name: "foo", Reader: reader}},
Expand Down

0 comments on commit 00768d4

Please sign in to comment.