shurcooL / githubv4

Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql).
MIT License
1.1k stars 89 forks source link

chore: Create go.mod and go.sum files #109

Closed wwsean08 closed 9 months ago

wwsean08 commented 1 year ago

Resolves #88

Description

This creates a go.mod/sum file for githubv4 by doing the following

  1. Renaming the example directory to _example in order to not put a hard requirement on golang.org/x/oauth2 for all packages as all go tools ignore directories and files starting with an underscore or dot according to the last sentence of this section
  2. Move example_test.go into the _example directory to prevent a hard requirement on golang.org/x/oauth2. This could cause a breaking change but seems unlikely given the function has no returns and just does print statements
  3. Create the initial go.mod and go.sum files. They likely could be based on an older version than 1.16, but I figured that was a good place to start.

The reason I am making the slight file changes to prevent a hard requirement on golang.org/x/auth2 is that this library doesn't actually care about how the end client gets the auth token, so long as it's provided, so this gives users a bit more flexibility and prevents them from taking an unneeded requirement.

Testing done

Ran the unit tests and verified nothing broke.

marco-m commented 9 months ago

Since now the githubv4 module has a go.mod file, it seems that this PR can be closed ?

dmitshur commented 9 months ago

Thanks. Closing.