Revert "Upgrade to go 1.19 and update dependencies (#3069)" (#3085)

This reverts commit bba7c23957.
This commit is contained in:
WithoutPants
2022-11-07 12:33:15 +11:00
committed by GitHub
parent bba7c23957
commit 2609095c7a
939 changed files with 43785 additions and 101302 deletions

View File

@@ -11,6 +11,6 @@ install:
- # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step).
script:
- go get -t -v ./...
- diff -n <(echo -n) <(gofmt -d -s .)
- go vet ./...
- diff -u <(echo -n) <(gofmt -d -s .)
- go tool vet .
- go test -v -race ./...

View File

@@ -7,6 +7,8 @@ Package `graphql` provides a GraphQL client implementation.
For more information, see package [`github.com/shurcooL/githubv4`](https://github.com/shurcooL/githubv4), which is a specialized version targeting GitHub GraphQL API v4. That package is driving the feature development.
**Status:** In active early research and development. The API will change when opportunities for improvement are discovered; it is not yet frozen.
Installation
------------

View File

@@ -4,5 +4,8 @@
// which is a specialized version targeting GitHub GraphQL API v4.
// That package is driving the feature development.
//
// Status: In active early research and development. The API will change when
// opportunities for improvement are discovered; it is not yet frozen.
//
// For now, see README for more details.
package graphql // import "github.com/shurcooL/graphql"

View File

@@ -180,6 +180,8 @@ func isTwoInitialisms(word string) (string, string, bool) {
// Only add entries that are highly unlikely to be non-initialisms.
// For instance, "ID" is fine (Freudian code is rare), but "AND" is not.
var initialisms = map[string]struct{}{
// These are the common initialisms from golint. Keep them in sync
// with https://gotools.org/github.com/golang/lint#commonInitialisms.
"ACL": {},
"API": {},
"ASCII": {},
@@ -199,7 +201,6 @@ var initialisms = map[string]struct{}{
"RAM": {},
"RHS": {},
"RPC": {},
"RSS": {},
"SLA": {},
"SMTP": {},
"SQL": {},
@@ -210,15 +211,18 @@ var initialisms = map[string]struct{}{
"UDP": {},
"UI": {},
"UID": {},
"UUID": {},
"URI": {},
"URL": {},
"UTF8": {},
"UUID": {},
"VM": {},
"XML": {},
"XMPP": {},
"XSRF": {},
"XSS": {},
// Additional common initialisms.
"RSS": {},
}
// isBrand reports whether word is a brand.
@@ -233,9 +237,4 @@ func isBrand(word string) (string, bool) {
// Only add entries that are highly unlikely to be non-brands.
var brands = map[string]string{
"github": "GitHub",
"gitlab": "GitLab",
"devops": "DevOps", // For https://en.wikipedia.org/wiki/DevOps.
// For https://docs.github.com/en/graphql/reference/enums#fundingplatform.
"issuehunt": "IssueHunt",
"lfx": "LFX",
}

View File

@@ -280,9 +280,10 @@ func hasGraphQLName(f reflect.StructField, name string) bool {
// GraphQL fragment. It doesn't have a name.
return false
}
// Cut off anything that follows the field name,
// such as field arguments, aliases, directives.
if i := strings.IndexAny(value, "(:@"); i != -1 {
if i := strings.Index(value, "("); i != -1 {
value = value[:i]
}
if i := strings.Index(value, ":"); i != -1 {
value = value[:i]
}
return strings.TrimSpace(value) == name