Skip to content

Commit 85f80ce

Browse files
fix(ci): normalize line endings and formatting repo-wide
1 parent 8955fd6 commit 85f80ce

22 files changed

Lines changed: 238 additions & 1604 deletions

File tree

example/appengine/app.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import (
1212
"net/http"
1313
"os"
1414

15-
"github.com/google/go-github/v82/github"
1615
"google.golang.org/appengine"
1716
"google.golang.org/appengine/log"
17+
18+
"github.com/google/go-github/v82/github"
1819
)
1920

2021
func init() {

example/basicauth/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ import (
2222
"os"
2323
"strings"
2424

25-
"github.com/google/go-github/v82/github"
2625
"golang.org/x/term"
26+
27+
"github.com/google/go-github/v82/github"
2728
)
2829

2930
func main() {

example/codespaces/newreposecretwithxcrypto/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ import (
3737
"log"
3838
"os"
3939

40-
"github.com/google/go-github/v82/github"
4140
"golang.org/x/crypto/nacl/box"
41+
42+
"github.com/google/go-github/v82/github"
4243
)
4344

4445
var (

example/codespaces/newusersecretwithxcrypto/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ import (
3838
"log"
3939
"os"
4040

41-
"github.com/google/go-github/v82/github"
4241
"golang.org/x/crypto/nacl/box"
42+
43+
"github.com/google/go-github/v82/github"
4344
)
4445

4546
var (

example/commitpr/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
"time"
3434

3535
"github.com/ProtonMail/go-crypto/openpgp"
36+
3637
"github.com/google/go-github/v82/github"
3738
)
3839

example/newfilewithappauth/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"time"
1717

1818
"github.com/bradleyfalzon/ghinstallation/v2"
19+
1920
"github.com/google/go-github/v82/github"
2021
)
2122

example/newreposecretwithlibsodium/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"os"
3737

3838
sodium "github.com/GoKillers/libsodium-go/cryptobox"
39+
3940
"github.com/google/go-github/v82/github"
4041
)
4142

example/newreposecretwithxcrypto/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ import (
3737
"log"
3838
"os"
3939

40-
"github.com/google/go-github/v82/github"
4140
"golang.org/x/crypto/nacl/box"
41+
42+
"github.com/google/go-github/v82/github"
4243
)
4344

4445
var (

example/otel/main.go

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
// Copyright 2026 The go-github AUTHORS. All rights reserved.
2-
2+
//
33
// Use of this source code is governed by a BSD-style
4-
54
// license that can be found in the LICENSE file.
65

76
// Package main provides examples for OpenTelemetry instrumentation.
8-
97
package main
108

119
import (
@@ -14,81 +12,54 @@ import (
1412
"log"
1513
"net/http"
1614

17-
"github.com/google/go-github/v82/github"
18-
"github.com/google/go-github/v82/otel"
1915
"go.opentelemetry.io/otel/exporters/stdout/stdouttrace"
2016
"go.opentelemetry.io/otel/sdk/trace"
17+
18+
"github.com/google/go-github/v82/github"
19+
"github.com/google/go-github/v82/otel"
2120
)
2221

2322
func main() {
24-
2523
// Initialize stdout exporter to see traces in console
26-
2724
exporter, err := stdouttrace.New(stdouttrace.WithPrettyPrint())
28-
2925
if err != nil {
30-
3126
log.Fatalf("failed to initialize stdouttrace exporter: %v", err)
32-
3327
}
3428

3529
tp := trace.NewTracerProvider(
36-
3730
trace.WithBatcher(exporter),
3831
)
3932

4033
defer func() {
41-
4234
if err := tp.Shutdown(context.Background()); err != nil {
43-
4435
log.Fatal(err)
45-
4636
}
47-
4837
}()
4938

5039
// Configure HTTP client with OTel transport
51-
5240
httpClient := &http.Client{
53-
5441
Transport: otel.NewTransport(
55-
5642
http.DefaultTransport,
57-
5843
otel.WithTracerProvider(tp),
5944
),
6045
}
6146

6247
// Create GitHub client
63-
6448
client := github.NewClient(httpClient)
6549

6650
// Make a request (Get Rate Limits is public and cheap)
67-
6851
limits, resp, err := client.RateLimit.Get(context.Background())
69-
7052
if err != nil {
71-
7253
log.Printf("Error fetching rate limits: %v", err)
73-
7454
} else {
75-
7655
fmt.Printf("Core Rate Limit: %v/%v (Resets at %v)\n",
77-
7856
limits.GetCore().Remaining,
79-
8057
limits.GetCore().Limit,
81-
82-
limits.GetCore().Reset)
83-
58+
limits.GetCore().Reset,
59+
)
8460
}
8561

86-
// Check if we captured attributes in response
87-
8862
if resp != nil {
89-
90-
fmt.Printf("Response Status: %v\n", resp.Status)
91-
63+
fmt.Printf("Request ID: %v\n", resp.Header.Get(github.HeaderGitHubRequestID))
9264
}
93-
9465
}

example/ratelimit/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/gofri/go-github-ratelimit/v2/github_ratelimit"
1818
"github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_primary_ratelimit"
1919
"github.com/gofri/go-github-ratelimit/v2/github_ratelimit/github_secondary_ratelimit"
20+
2021
"github.com/google/go-github/v82/github"
2122
)
2223

0 commit comments

Comments
 (0)