@@ -45,7 +45,7 @@ if err != nil {
4545
4646fmt.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