diff --git a/pkg/gojenkins/request.go b/pkg/gojenkins/request.go index 7daec813ffc23d71ead88dc944e5015a4c59cecf..25cc3e06451cdcfadaf42b0d33a651a94f115e75 100644 --- a/pkg/gojenkins/request.go +++ b/pkg/gojenkins/request.go @@ -84,7 +84,7 @@ func (r *Requester) PostJSON(endpoint string, payload io.Reader, responseStruct } ar.SetHeader("Content-Type", "application/x-www-form-urlencoded") ar.Suffix = "api/json" - return r.Do(ar, &responseStruct, querystring) + return r.Do(ar, responseStruct, querystring) } func (r *Requester) Post(endpoint string, payload io.Reader, responseStruct interface{}, querystring map[string]string) (*http.Response, error) { @@ -94,7 +94,7 @@ func (r *Requester) Post(endpoint string, payload io.Reader, responseStruct inte } ar.SetHeader("Content-Type", "application/x-www-form-urlencoded") ar.Suffix = "" - return r.Do(ar, &responseStruct, querystring) + return r.Do(ar, responseStruct, querystring) } func (r *Requester) PostForm(endpoint string, payload io.Reader, responseStruct interface{}, formString map[string]string) (*http.Response, error) { ar := NewAPIRequest("POST", endpoint, payload) @@ -103,7 +103,7 @@ func (r *Requester) PostForm(endpoint string, payload io.Reader, responseStruct } ar.SetHeader("Content-Type", "application/x-www-form-urlencoded") ar.Suffix = "" - return r.DoPostForm(ar, &responseStruct, formString) + return r.DoPostForm(ar, responseStruct, formString) } func (r *Requester) PostFiles(endpoint string, payload io.Reader, responseStruct interface{}, querystring map[string]string, files []string) (*http.Response, error) { @@ -111,7 +111,7 @@ func (r *Requester) PostFiles(endpoint string, payload io.Reader, responseStruct if err := r.SetCrumb(ar); err != nil { return nil, err } - return r.Do(ar, &responseStruct, querystring, files) + return r.Do(ar, responseStruct, querystring, files) } func (r *Requester) PostXML(endpoint string, xml string, responseStruct interface{}, querystring map[string]string) (*http.Response, error) { @@ -122,14 +122,14 @@ func (r *Requester) PostXML(endpoint string, xml string, responseStruct interfac } ar.SetHeader("Content-Type", "application/xml;charset=utf-8") ar.Suffix = "" - return r.Do(ar, &responseStruct, querystring) + return r.Do(ar, responseStruct, querystring) } func (r *Requester) GetJSON(endpoint string, responseStruct interface{}, query map[string]string) (*http.Response, error) { ar := NewAPIRequest("GET", endpoint, nil) ar.SetHeader("Content-Type", "application/json") ar.Suffix = "api/json" - return r.Do(ar, &responseStruct, query) + return r.Do(ar, responseStruct, query) } func (r *Requester) GetXML(endpoint string, responseStruct interface{}, query map[string]string) (*http.Response, error) {