Skip to content

Commit ed4f59f

Browse files
committed
rename v to data
1 parent 994e9ee commit ed4f59f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if err != nil {
4545
4646
fmt.Printf("%+v\n", resp)
4747
*/
48-
func graphQL(query string, variables map[string]string, v interface{}) error {
48+
func graphQL(query string, variables map[string]string, data interface{}) error {
4949
url := "https://api.github.com/graphql"
5050
reqBody, err := json.Marshal(map[string]interface{}{"query": query, "variables": variables})
5151
if err != nil {
@@ -81,17 +81,17 @@ func graphQL(query string, variables map[string]string, v interface{}) error {
8181
}
8282

8383
debugResponse(resp, string(body))
84-
return handleResponse(resp, body, v)
84+
return handleResponse(resp, body, data)
8585
}
8686

87-
func handleResponse(resp *http.Response, body []byte, v interface{}) error {
87+
func handleResponse(resp *http.Response, body []byte, data interface{}) error {
8888
success := resp.StatusCode >= 200 && resp.StatusCode < 300
8989

9090
if !success {
9191
return handleHTTPError(resp, body)
9292
}
9393

94-
gr := &graphQLResponse{Data: v}
94+
gr := &graphQLResponse{Data: data}
9595
err := json.Unmarshal(body, &gr)
9696
if err != nil {
9797
return err

0 commit comments

Comments
 (0)