Skip to content

go-gh 2.0.0

Compare
Choose a tag to compare
@samcoe samcoe released this 16 Apr 05:13
· 53 commits to trunk since this release
9330cac

What's Changed

This is a fairly large release with a couple new features and a bunch of tech debt cleanup for go-gh.
As part of keeping this library maintainable and inline with best Go practices we have made breaking changes to a couple of the packages thus constituting a bump of the major version to v2.0.0.
Below are the listed changes ordered by package as well as migration guidelines when applicable.

gh package

  • Move CurrentRepository function from top level gh package to repository package.
    • To migrate: gh.CurrentRepository -> repository.Current
  • Move RESTClient function from top level gh package to api package.
    • To migrate: gh.RESTClient -> api.DefaultRESTClient or api.NewRESTClient
  • Move GQLClient function from top level gh package to api package.
    • To migrate: gh.GQlClient -> api.DefaultGraphQLClient or api.NewGraphQLClient
  • Move HTTPClient function from top level gh package to api package.
    • To migrate: gh.HTTPClient -> api.DefaultHTTPClient or api.NewHTTPClient
  • Add ExecInteractive by @stemar94 in #115
  • Add ExecContext function by @mislav in #115
  • Add support for GH_PATH environment variable to Exec functions by @mislav in #115

api package

  • Change references of GQL to GraphQL.
    • To migrate: api.GQLError -> api.GraphQLError
    • To migrate: api.GQLErrorItem -> api.GraphQLErrorItem
  • Change ClientOptions to be used with value semantics instead of pointer semantics.
    • This allows ClientOptions to be used with multiple clients without having to worry about them being modified.
  • Added DefaultRESTClient, DefaultHTTPClient, DefaultGraphQLClient convenience factory functions.
  • Change RESTClient interface type to a concrete type.
  • Change GraphQLClient interface type to a concrete type.
  • Change methods on HTTPError and GraphQLError custom error types to take pointers as method receivers.
  • Change GraphQLClient Query and Mutate methods to return GraphQLError instead of shurcooL/graphql.Errors.

browser package

  • Change New factory function to return *Browser instead of Browser.

config package

  • Change methods on InvalidConfigFileError and KeyNotFoundError custom error types to take pointers as method receivers.

jq package

  • Add EvaluateFormatted function to pretty print JSON output by @mjpieters in #116

repository package

  • Change Repository interface type to a concrete type.

ssh package

  • Handle errors when resolving ssh aliases to hostnames by @mislav in #111

template package

  • Change New factory function to return *Template instead of Template.

Other changes

  • Properly handle closing of files after writing by @samcoe in #113

New Contributors

Full Changelog: v1.2.1...v2.0.0