Skip to content

Commit 7a22b94

Browse files
committed
Remove rawQuery argument to newRequest() as per linter
1 parent 6bb6968 commit 7a22b94

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

client/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (c *Client) Submit(ctx context.Context, br BuildRequest) (bi BuildInfo, err
2323
return
2424
}
2525

26-
req, err := c.newRequest(http.MethodPost, "/v1/build", "", bytes.NewReader(b))
26+
req, err := c.newRequest(http.MethodPost, "/v1/build", bytes.NewReader(b))
2727
if err != nil {
2828
return
2929
}
@@ -47,7 +47,7 @@ func (c *Client) Submit(ctx context.Context, br BuildRequest) (bi BuildInfo, err
4747
// Cancel cancels an existing build. The context controls the lifetime of the
4848
// request.
4949
func (c *Client) Cancel(ctx context.Context, buildID string) error {
50-
req, err := c.newRequest(http.MethodPut, fmt.Sprintf("/v1/build/%s/_cancel", buildID), "", nil)
50+
req, err := c.newRequest(http.MethodPut, fmt.Sprintf("/v1/build/%s/_cancel", buildID), nil)
5151
if err != nil {
5252
return err
5353
}

client/client.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,9 @@ func New(cfg *Config) (c *Client, err error) {
8888
}
8989

9090
// newRequest returns a new Request given a method, path, query, and optional body.
91-
func (c *Client) newRequest(method, path, rawQuery string, body io.Reader) (r *http.Request, err error) {
91+
func (c *Client) newRequest(method, path string, body io.Reader) (r *http.Request, err error) {
9292
u := c.BaseURL.ResolveReference(&url.URL{
93-
Path: path,
94-
RawQuery: rawQuery,
93+
Path: path,
9594
})
9695

9796
r, err = http.NewRequest(method, u.String(), body)

client/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
// GetStatus gets the status of a build from the Build Service by build ID
1616
func (c *Client) GetStatus(ctx context.Context, buildID string) (bi BuildInfo, err error) {
17-
req, err := c.newRequest(http.MethodGet, "/v1/build/"+buildID, "", nil)
17+
req, err := c.newRequest(http.MethodGet, "/v1/build/"+buildID, nil)
1818
if err != nil {
1919
return
2020
}

client/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type VersionInfo struct {
2222
// GetVersion gets version information from the build service. The context
2323
// controls the lifetime of the request.
2424
func (c *Client) GetVersion(ctx context.Context) (vi VersionInfo, err error) {
25-
req, err := c.newRequest(http.MethodGet, pathVersion, "", nil)
25+
req, err := c.newRequest(http.MethodGet, pathVersion, nil)
2626
if err != nil {
2727
return VersionInfo{}, err
2828
}

0 commit comments

Comments
 (0)