Skip to content

Commit 5f331e3

Browse files
committed
test: fixed test
1 parent 27d61bb commit 5f331e3

File tree

2 files changed

+33
-34
lines changed

2 files changed

+33
-34
lines changed

bluemix/configuration/core_config/bx_config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ func TestPaginationURLs(t *testing.T) {
484484
LastIndex: 50,
485485
},
486486
}
487-
err = config.SetPaginationURLs(expected)
487+
config.SetPaginationURLs(expected)
488488
assert.Nil(t, err)
489489

490490
paginationURLs, err = config.PaginationURLs()

common/rest/request.go

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
11
// Request examples:
2+
// // create a simple GET request
3+
// req := GetRequest("http://www.example.com")
24
//
3-
// // create a simple GET request
4-
// req := GetRequest("http://www.example.com")
5+
// // set header
6+
// req.Set("Accept", "application/json")
57
//
6-
// // set header
7-
// req.Set("Accept", "application/json")
8+
// // set query parameters
9+
// req.Query("foo1", "bar1")
10+
// req.Query("foo2", "bar2")
811
//
9-
// // set query parameters
10-
// req.Query("foo1", "bar1")
11-
// req.Query("foo2", "bar2")
12+
// // Build to a HTTP request
13+
// req.Build()
1214
//
13-
// // Build to a HTTP request
14-
// req.Build()
15+
// // method chaining is also supported
16+
// // the above is equal to:
17+
// GetRequest("http://www.example.com").
18+
// Set("Accept", "application/json").
19+
// Query("foo1", "bar1").
20+
// Query("foo2", "bar2").
21+
// Build()
1522
//
16-
// // method chaining is also supported
17-
// // the above is equal to:
18-
// GetRequest("http://www.example.com").
19-
// Set("Accept", "application/json").
20-
// Query("foo1", "bar1").
21-
// Query("foo2", "bar2").
22-
// Build()
23+
// // struct body
24+
// foo = Foo{Bar: "val"}
25+
// PostRequest("http://www.example.com").
26+
// Body(foo)
2327
//
24-
// // struct body
25-
// foo = Foo{Bar: "val"}
26-
// PostRequest("http://www.example.com").
27-
// Body(foo)
28+
// // String body
29+
// PostRequest("http://www.example.com").
30+
// Body("{\"bar\": \"val\"}")
2831
//
29-
// // String body
30-
// PostRequest("http://www.example.com").
31-
// Body("{\"bar\": \"val\"}")
32+
// // Stream body
33+
// PostRequest("http://www.example.com").
34+
// Body(strings.NewReader("abcde"))
3235
//
33-
// // Stream body
34-
// PostRequest("http://www.example.com").
35-
// Body(strings.NewReader("abcde"))
36-
//
37-
// // Multipart POST request
38-
// var f *os.File
39-
// PostRequest("http://www.example.com").
40-
// Field("foo", "bar").
41-
// File("file1", File{Name: f.Name(), Content: f}).
42-
// File("file2", File{Name: "1.txt", Content: []byte("abcde"), Type: "text/plain"})
36+
// // Multipart POST request
37+
// var f *os.File
38+
// PostRequest("http://www.example.com").
39+
// Field("foo", "bar").
40+
// File("file1", File{Name: f.Name(), Content: f}).
41+
// File("file2", File{Name: "1.txt", Content: []byte("abcde"), Type: "text/plain"})
4342
package rest
4443

4544
import (

0 commit comments

Comments
 (0)