From f7b6d824f0f1f455520fcd4cfc172300cd16938c Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Thu, 29 Jan 2026 20:06:25 +0200 Subject: [PATCH 1/3] chore: Format code with golangci-lint fmt --- .golangci.yml | 8 ++++++++ CONTRIBUTING.md | 2 +- example/appengine/app.go | 3 ++- example/basicauth/main.go | 3 ++- .../newreposecretwithxcrypto/main.go | 3 ++- .../newusersecretwithxcrypto/main.go | 3 ++- example/commitpr/main.go | 1 + example/newfilewithappauth/main.go | 1 + example/newreposecretwithlibsodium/main.go | 1 + example/newreposecretwithxcrypto/main.go | 3 ++- example/ratelimit/main.go | 1 + example/tokenauth/main.go | 3 ++- example/verifyartifact/main.go | 3 ++- ...rprise_codesecurity_configurations_test.go | 10 +++++----- github/github.go | 2 +- .../orgs_codesecurity_configurations_test.go | 12 +++++------ github/timestamp.go | 2 +- scrape/apps.go | 1 + scrape/apps_test.go | 1 + script/fmt.sh | 7 +++++-- script/lint.sh | 12 ++--------- script/setup-custom-gcl.sh | 20 +++++++++++++++++++ test/integration/repos_test.go | 1 + tools/metadata/main.go | 1 + tools/metadata/main_test.go | 1 + tools/metadata/metadata.go | 3 ++- tools/metadata/openapi.go | 3 ++- 27 files changed, 76 insertions(+), 35 deletions(-) create mode 100755 script/setup-custom-gcl.sh diff --git a/.golangci.yml b/.golangci.yml index d1926205b46..32278f09b76 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -470,3 +470,11 @@ formatters: - gofmt - gofumpt - goimports + settings: + gci: + sections: + - standard + - default + - prefix(github.com/google/go-github/) + gofumpt: + extra-rules: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d49b7be1ad..bc1892e9842 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -235,7 +235,7 @@ Its subcommands are: The `script` directory has shell scripts that help with common development tasks. -**script/fmt.sh** formats all go code in the repository. +**script/fmt.sh** formats all Go code in the repository. **script/generate.sh** runs code generators and `go mod tidy` on all modules. With `--check` it checks that the generated files are current. diff --git a/example/appengine/app.go b/example/appengine/app.go index f6cca89253a..e5118d52847 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,9 +12,10 @@ import ( "net/http" "os" - "github.com/google/go-github/v82/github" "google.golang.org/appengine" "google.golang.org/appengine/log" + + "github.com/google/go-github/v82/github" ) func init() { diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 926bdf25ec9..3babce2d8f2 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,8 +22,9 @@ import ( "os" "strings" - "github.com/google/go-github/v82/github" "golang.org/x/term" + + "github.com/google/go-github/v82/github" ) func main() { diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 64d5e8bcfc8..789a50cac26 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -37,8 +37,9 @@ import ( "log" "os" - "github.com/google/go-github/v82/github" "golang.org/x/crypto/nacl/box" + + "github.com/google/go-github/v82/github" ) var ( diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index 8b731ae0b50..cb221e44076 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -38,8 +38,9 @@ import ( "log" "os" - "github.com/google/go-github/v82/github" "golang.org/x/crypto/nacl/box" + + "github.com/google/go-github/v82/github" ) var ( diff --git a/example/commitpr/main.go b/example/commitpr/main.go index c3b15c38e5a..04c6394421c 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,6 +33,7 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" + "github.com/google/go-github/v82/github" ) diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index b66ef94545d..070a09fd5df 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,6 +16,7 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" + "github.com/google/go-github/v82/github" ) diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 623578cdf5d..2265386f9b7 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,6 +36,7 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" + "github.com/google/go-github/v82/github" ) diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index 3ba048aac9b..dda605ca916 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -37,8 +37,9 @@ import ( "log" "os" - "github.com/google/go-github/v82/github" "golang.org/x/crypto/nacl/box" + + "github.com/google/go-github/v82/github" ) var ( diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index 7e1c101d975..e43f41b2e11 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -17,6 +17,7 @@ import ( "github.com/gofri/go-github-ratelimit/v2/github_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_primary_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_secondary_ratelimit" + "github.com/google/go-github/v82/github" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index ceb0f87c313..908b03cc7c3 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,8 +15,9 @@ import ( "log" "os" - "github.com/google/go-github/v82/github" "golang.org/x/term" + + "github.com/google/go-github/v82/github" ) func main() { diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index 027fe82e033..f4fad306a0c 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -18,10 +18,11 @@ import ( "log" "os" - "github.com/google/go-github/v82/github" "github.com/sigstore/sigstore-go/pkg/bundle" "github.com/sigstore/sigstore-go/pkg/root" "github.com/sigstore/sigstore-go/pkg/verify" + + "github.com/google/go-github/v82/github" ) var ( diff --git a/github/enterprise_codesecurity_configurations_test.go b/github/enterprise_codesecurity_configurations_test.go index 34c6fe052cf..02d2d1fc612 100644 --- a/github/enterprise_codesecurity_configurations_test.go +++ b/github/enterprise_codesecurity_configurations_test.go @@ -253,7 +253,7 @@ func TestEnterpriseService_UpdateCodeSecurityConfiguration(t *testing.T) { const methodName = "UpdateCodeSecurityConfiguration" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Enterprise.UpdateCodeSecurityConfiguration(ctx, "\n", -1, input) - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { @@ -288,7 +288,7 @@ func TestEnterpriseService_DeleteCodeSecurityConfiguration(t *testing.T) { const methodName = "DeleteCodeSecurityConfiguration" testBadOptions(t, methodName, func() (err error) { _, err = client.Enterprise.DeleteCodeSecurityConfiguration(ctx, "\n", -1) - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { @@ -328,7 +328,7 @@ func TestEnterpriseService_AttachCodeSecurityConfigurationToRepositories(t *test const methodName = "AttachCodeSecurityConfigurationToRepositories" testBadOptions(t, methodName, func() (err error) { _, err = client.Enterprise.AttachCodeSecurityConfigurationToRepositories(ctx, "\n", -1, "") - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { @@ -377,7 +377,7 @@ func TestEnterpriseService_SetDefaultCodeSecurityConfiguration(t *testing.T) { const methodName = "SetDefaultCodeSecurityConfiguration" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Enterprise.SetDefaultCodeSecurityConfiguration(ctx, "\n", -1, "") - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { @@ -431,7 +431,7 @@ func TestEnterpriseService_ListCodeSecurityConfigurationRepositories(t *testing. const methodName = "ListCodeSecurityConfigurationRepositories" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Enterprise.ListCodeSecurityConfigurationRepositories(ctx, "\n", -1, opts) - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { diff --git a/github/github.go b/github/github.go index a806e7b8030..27ab84e01d5 100644 --- a/github/github.go +++ b/github/github.go @@ -5,7 +5,7 @@ //go:generate go run gen-accessors.go //go:generate go run gen-stringify-test.go -//go:generate ../script/metadata.sh update-go +//go:generate sh ../script/metadata.sh update-go package github diff --git a/github/orgs_codesecurity_configurations_test.go b/github/orgs_codesecurity_configurations_test.go index 23a3972108f..0ee45657694 100644 --- a/github/orgs_codesecurity_configurations_test.go +++ b/github/orgs_codesecurity_configurations_test.go @@ -391,7 +391,7 @@ func TestOrganizationsService_UpdateCodeSecurityConfiguration(t *testing.T) { const methodName = "UpdateCodeSecurityConfiguration" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Organizations.UpdateCodeSecurityConfiguration(ctx, "\n", -1, input) - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { @@ -426,7 +426,7 @@ func TestOrganizationsService_DeleteCodeSecurityConfiguration(t *testing.T) { const methodName = "DeleteCodeSecurityConfiguration" testBadOptions(t, methodName, func() (err error) { _, err = client.Organizations.DeleteCodeSecurityConfiguration(ctx, "\n", -1) - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { @@ -470,7 +470,7 @@ func TestOrganizationsService_AttachCodeSecurityConfigurationToRepositories(t *t const methodName = "AttachCodeSecurityConfigurationToRepositories" testBadOptions(t, methodName, func() (err error) { _, err = client.Organizations.AttachCodeSecurityConfigurationToRepositories(ctx, "\n", -1, "", nil) - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { @@ -519,7 +519,7 @@ func TestOrganizationsService_SetDefaultCodeSecurityConfiguration(t *testing.T) const methodName = "SetDefaultCodeSecurityConfiguration" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Organizations.SetDefaultCodeSecurityConfiguration(ctx, "\n", -1, "") - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { @@ -573,7 +573,7 @@ func TestOrganizationsService_ListCodeSecurityConfigurationRepositories(t *testi const methodName = "ListCodeSecurityConfigurationRepositories" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Organizations.ListCodeSecurityConfigurationRepositories(ctx, "\n", -1, opts) - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { @@ -619,7 +619,7 @@ func TestOrganizationsService_GetCodeSecurityConfigurationForRepository(t *testi const methodName = "GetCodeSecurityConfigurationForRepository" testBadOptions(t, methodName, func() (err error) { _, _, err = client.Organizations.GetCodeSecurityConfigurationForRepository(ctx, "\n", "\n") - return + return err }) testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) { diff --git a/github/timestamp.go b/github/timestamp.go index 71660193bb3..a26077da255 100644 --- a/github/timestamp.go +++ b/github/timestamp.go @@ -43,7 +43,7 @@ func (t *Timestamp) UnmarshalJSON(data []byte) (err error) { } else { t.Time, err = time.Parse(`"`+time.RFC3339+`"`, str) } - return + return err } // Equal reports whether t and u are equal based on time.Equal. diff --git a/scrape/apps.go b/scrape/apps.go index 306ae4b6c8a..75846029b46 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,6 +18,7 @@ import ( "strings" "github.com/PuerkitoBio/goquery" + "github.com/google/go-github/v82/github" ) diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 07fcfd4960b..1d5213d20fd 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "github.com/google/go-github/v82/github" ) diff --git a/script/fmt.sh b/script/fmt.sh index 20ff6e69254..13400c08569 100755 --- a/script/fmt.sh +++ b/script/fmt.sh @@ -1,8 +1,11 @@ #!/bin/sh -#/ script/fmt.sh runs go fmt on all go files in the project. +#/ script/fmt.sh runs formatting on all Go files in the project. +#/ It uses custom golangci-lint to format the code. set -e +CUSTOM_GCL="$(script/setup-custom-gcl.sh)" + CDPATH="" cd -- "$(dirname -- "$0")/.." MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" @@ -10,6 +13,6 @@ MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" for dir in $MOD_DIRS; do ( cd "$dir" - go fmt ./... + "$CUSTOM_GCL" fmt ) done diff --git a/script/lint.sh b/script/lint.sh index ba9fd89a648..ae3878b9f40 100755 --- a/script/lint.sh +++ b/script/lint.sh @@ -5,13 +5,11 @@ set -e -GOLANGCI_LINT_VERSION="2.7.0" +CUSTOM_GCL="$(script/setup-custom-gcl.sh)" CDPATH="" cd -- "$(dirname -- "$0")/.." BIN="$(pwd -P)"/bin -mkdir -p "$BIN" - EXIT_CODE=0 fail() { @@ -19,12 +17,6 @@ fail() { EXIT_CODE=1 } -# install golangci-lint and custom-gcl in ./bin if they don't exist with the correct version -if ! "$BIN"/custom-gcl --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then - GOBIN="$BIN" go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION" - "$BIN"/golangci-lint custom --name custom-gcl --destination "$BIN" -fi - MOD_DIRS="$(git ls-files '*go.mod' | xargs dirname | sort)" for dir in $MOD_DIRS; do @@ -32,7 +24,7 @@ for dir in $MOD_DIRS; do echo linting "$dir" ( cd "$dir" - "$BIN"/custom-gcl run + "$CUSTOM_GCL" run ) || fail "failed linting $dir" done diff --git a/script/setup-custom-gcl.sh b/script/setup-custom-gcl.sh new file mode 100755 index 00000000000..e4f1cc81725 --- /dev/null +++ b/script/setup-custom-gcl.sh @@ -0,0 +1,20 @@ +#!/bin/sh +#/ script/setup-custom-gcl.sh ensures custom golangci-lint is installed. +#/ It returns the path to the custom-gcl binary. + +set -e + +GOLANGCI_LINT_VERSION="2.7.0" + +# should in sync with fmt.sh and lint.sh +BIN="$(pwd -P)"/bin + +mkdir -p "$BIN" + +# install golangci-lint and custom-gcl in ./bin if they don't exist with the correct version +if ! "$BIN"/custom-gcl --version 2> /dev/null | grep -q "$GOLANGCI_LINT_VERSION"; then + GOBIN="$BIN" go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v$GOLANGCI_LINT_VERSION" + "$BIN"/golangci-lint custom --name custom-gcl --destination "$BIN" +fi + +echo "$BIN/custom-gcl" diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 84264bcac2f..59d392b9334 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -13,6 +13,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "github.com/google/go-github/v82/github" ) diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 38834612d8b..8d2d8566224 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -16,6 +16,7 @@ import ( "path/filepath" "github.com/alecthomas/kong" + "github.com/google/go-github/v82/github" ) diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index ea64e6b289a..099a5417782 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,6 +23,7 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" + "github.com/google/go-github/v82/github" ) diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index af4b8ed05ce..ad3925f44fd 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,8 +24,9 @@ import ( "strings" "sync" - "github.com/google/go-github/v82/github" "gopkg.in/yaml.v3" + + "github.com/google/go-github/v82/github" ) type operation struct { diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 2986653837d..2a72a01ac85 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,8 +14,9 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "github.com/google/go-github/v82/github" "golang.org/x/sync/errgroup" + + "github.com/google/go-github/v82/github" ) const ( From ba20903d83bc46e4aa7604962e3d49aef09eb901 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 30 Jan 2026 16:57:02 +0200 Subject: [PATCH 2/3] gci format imports into two sections --- .golangci.yml | 5 ----- example/appengine/app.go | 3 +-- example/basicauth/main.go | 3 +-- example/codespaces/newreposecretwithxcrypto/main.go | 3 +-- example/codespaces/newusersecretwithxcrypto/main.go | 3 +-- example/commitpr/main.go | 1 - example/newfilewithappauth/main.go | 1 - example/newreposecretwithlibsodium/main.go | 1 - example/newreposecretwithxcrypto/main.go | 3 +-- example/ratelimit/main.go | 1 - example/tokenauth/main.go | 3 +-- example/verifyartifact/main.go | 3 +-- scrape/apps.go | 1 - scrape/apps_test.go | 1 - test/integration/repos_test.go | 1 - tools/metadata/main.go | 1 - tools/metadata/main_test.go | 1 - tools/metadata/metadata.go | 3 +-- tools/metadata/openapi.go | 3 +-- 19 files changed, 9 insertions(+), 32 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 32278f09b76..1525db660ce 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -471,10 +471,5 @@ formatters: - gofumpt - goimports settings: - gci: - sections: - - standard - - default - - prefix(github.com/google/go-github/) gofumpt: extra-rules: true diff --git a/example/appengine/app.go b/example/appengine/app.go index e5118d52847..f6cca89253a 100644 --- a/example/appengine/app.go +++ b/example/appengine/app.go @@ -12,10 +12,9 @@ import ( "net/http" "os" + "github.com/google/go-github/v82/github" "google.golang.org/appengine" "google.golang.org/appengine/log" - - "github.com/google/go-github/v82/github" ) func init() { diff --git a/example/basicauth/main.go b/example/basicauth/main.go index 3babce2d8f2..926bdf25ec9 100644 --- a/example/basicauth/main.go +++ b/example/basicauth/main.go @@ -22,9 +22,8 @@ import ( "os" "strings" - "golang.org/x/term" - "github.com/google/go-github/v82/github" + "golang.org/x/term" ) func main() { diff --git a/example/codespaces/newreposecretwithxcrypto/main.go b/example/codespaces/newreposecretwithxcrypto/main.go index 789a50cac26..64d5e8bcfc8 100644 --- a/example/codespaces/newreposecretwithxcrypto/main.go +++ b/example/codespaces/newreposecretwithxcrypto/main.go @@ -37,9 +37,8 @@ import ( "log" "os" - "golang.org/x/crypto/nacl/box" - "github.com/google/go-github/v82/github" + "golang.org/x/crypto/nacl/box" ) var ( diff --git a/example/codespaces/newusersecretwithxcrypto/main.go b/example/codespaces/newusersecretwithxcrypto/main.go index cb221e44076..8b731ae0b50 100644 --- a/example/codespaces/newusersecretwithxcrypto/main.go +++ b/example/codespaces/newusersecretwithxcrypto/main.go @@ -38,9 +38,8 @@ import ( "log" "os" - "golang.org/x/crypto/nacl/box" - "github.com/google/go-github/v82/github" + "golang.org/x/crypto/nacl/box" ) var ( diff --git a/example/commitpr/main.go b/example/commitpr/main.go index 04c6394421c..c3b15c38e5a 100644 --- a/example/commitpr/main.go +++ b/example/commitpr/main.go @@ -33,7 +33,6 @@ import ( "time" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/google/go-github/v82/github" ) diff --git a/example/newfilewithappauth/main.go b/example/newfilewithappauth/main.go index 070a09fd5df..b66ef94545d 100644 --- a/example/newfilewithappauth/main.go +++ b/example/newfilewithappauth/main.go @@ -16,7 +16,6 @@ import ( "time" "github.com/bradleyfalzon/ghinstallation/v2" - "github.com/google/go-github/v82/github" ) diff --git a/example/newreposecretwithlibsodium/main.go b/example/newreposecretwithlibsodium/main.go index 2265386f9b7..623578cdf5d 100644 --- a/example/newreposecretwithlibsodium/main.go +++ b/example/newreposecretwithlibsodium/main.go @@ -36,7 +36,6 @@ import ( "os" sodium "github.com/GoKillers/libsodium-go/cryptobox" - "github.com/google/go-github/v82/github" ) diff --git a/example/newreposecretwithxcrypto/main.go b/example/newreposecretwithxcrypto/main.go index dda605ca916..3ba048aac9b 100644 --- a/example/newreposecretwithxcrypto/main.go +++ b/example/newreposecretwithxcrypto/main.go @@ -37,9 +37,8 @@ import ( "log" "os" - "golang.org/x/crypto/nacl/box" - "github.com/google/go-github/v82/github" + "golang.org/x/crypto/nacl/box" ) var ( diff --git a/example/ratelimit/main.go b/example/ratelimit/main.go index e43f41b2e11..7e1c101d975 100644 --- a/example/ratelimit/main.go +++ b/example/ratelimit/main.go @@ -17,7 +17,6 @@ import ( "github.com/gofri/go-github-ratelimit/v2/github_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_primary_ratelimit" "github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_secondary_ratelimit" - "github.com/google/go-github/v82/github" ) diff --git a/example/tokenauth/main.go b/example/tokenauth/main.go index 908b03cc7c3..ceb0f87c313 100644 --- a/example/tokenauth/main.go +++ b/example/tokenauth/main.go @@ -15,9 +15,8 @@ import ( "log" "os" - "golang.org/x/term" - "github.com/google/go-github/v82/github" + "golang.org/x/term" ) func main() { diff --git a/example/verifyartifact/main.go b/example/verifyartifact/main.go index f4fad306a0c..027fe82e033 100644 --- a/example/verifyartifact/main.go +++ b/example/verifyartifact/main.go @@ -18,11 +18,10 @@ import ( "log" "os" + "github.com/google/go-github/v82/github" "github.com/sigstore/sigstore-go/pkg/bundle" "github.com/sigstore/sigstore-go/pkg/root" "github.com/sigstore/sigstore-go/pkg/verify" - - "github.com/google/go-github/v82/github" ) var ( diff --git a/scrape/apps.go b/scrape/apps.go index 75846029b46..306ae4b6c8a 100644 --- a/scrape/apps.go +++ b/scrape/apps.go @@ -18,7 +18,6 @@ import ( "strings" "github.com/PuerkitoBio/goquery" - "github.com/google/go-github/v82/github" ) diff --git a/scrape/apps_test.go b/scrape/apps_test.go index 1d5213d20fd..07fcfd4960b 100644 --- a/scrape/apps_test.go +++ b/scrape/apps_test.go @@ -10,7 +10,6 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v82/github" ) diff --git a/test/integration/repos_test.go b/test/integration/repos_test.go index 59d392b9334..84264bcac2f 100644 --- a/test/integration/repos_test.go +++ b/test/integration/repos_test.go @@ -13,7 +13,6 @@ import ( "testing" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v82/github" ) diff --git a/tools/metadata/main.go b/tools/metadata/main.go index 8d2d8566224..38834612d8b 100644 --- a/tools/metadata/main.go +++ b/tools/metadata/main.go @@ -16,7 +16,6 @@ import ( "path/filepath" "github.com/alecthomas/kong" - "github.com/google/go-github/v82/github" ) diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 099a5417782..ea64e6b289a 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -23,7 +23,6 @@ import ( "github.com/alecthomas/kong" "github.com/getkin/kin-openapi/openapi3" "github.com/google/go-cmp/cmp" - "github.com/google/go-github/v82/github" ) diff --git a/tools/metadata/metadata.go b/tools/metadata/metadata.go index ad3925f44fd..af4b8ed05ce 100644 --- a/tools/metadata/metadata.go +++ b/tools/metadata/metadata.go @@ -24,9 +24,8 @@ import ( "strings" "sync" - "gopkg.in/yaml.v3" - "github.com/google/go-github/v82/github" + "gopkg.in/yaml.v3" ) type operation struct { diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 2a72a01ac85..2986653837d 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -14,9 +14,8 @@ import ( "strconv" "github.com/getkin/kin-openapi/openapi3" - "golang.org/x/sync/errgroup" - "github.com/google/go-github/v82/github" + "golang.org/x/sync/errgroup" ) const ( From cde61aafce22ab73bc1a807374d9c6b45a421f74 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Fri, 30 Jan 2026 16:58:14 +0200 Subject: [PATCH 3/3] revert go:generate change --- github/github.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/github.go b/github/github.go index 27ab84e01d5..a806e7b8030 100644 --- a/github/github.go +++ b/github/github.go @@ -5,7 +5,7 @@ //go:generate go run gen-accessors.go //go:generate go run gen-stringify-test.go -//go:generate sh ../script/metadata.sh update-go +//go:generate ../script/metadata.sh update-go package github