Skip to content

Commit 702ab1b

Browse files
authored
Merge pull request #25 from tstromberg/main
upgrade go.mods
2 parents c743b4d + e2b50f7 commit 702ab1b

File tree

26 files changed

+1580
-1247
lines changed

26 files changed

+1580
-1247
lines changed

.golangci.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ linters:
122122
struct-method: false
123123

124124
gocognit:
125-
min-complexity: 65
125+
min-complexity: 55
126126

127127
gocritic:
128128
enable-all: true
@@ -143,11 +143,6 @@ linters:
143143
govet:
144144
enable-all: true
145145

146-
maintidx:
147-
# Maintainability Index threshold (default: 20)
148-
# ExtrapolateFromSamples is a straightforward calculation with clear linear logic
149-
under: 16
150-
151146
godot:
152147
scope: toplevel
153148

@@ -182,7 +177,7 @@ linters:
182177
- name: cyclomatic
183178
disabled: true # prefer maintidx
184179
- name: function-length
185-
arguments: [150, 300]
180+
arguments: [150, 225]
186181
- name: line-length-limit
187182
arguments: [150]
188183
- name: nested-structs
@@ -191,8 +186,8 @@ linters:
191186
arguments: [10]
192187
- name: flag-parameter # fixes are difficult
193188
disabled: true
194-
- name: use-waitgroup-go
195-
disabled: true # wg.Add/Done pattern is idiomatic Go
189+
- name: bare-return
190+
disabled: true
196191

197192
rowserrcheck:
198193
# database/sql is always checked.

Makefile

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,28 @@ endif
3131
LINTERS :=
3232
FIXERS :=
3333

34+
SHELLCHECK_VERSION ?= v0.11.0
35+
SHELLCHECK_BIN := $(LINT_ROOT)/out/linters/shellcheck-$(SHELLCHECK_VERSION)-$(LINT_ARCH)
36+
$(SHELLCHECK_BIN):
37+
mkdir -p $(LINT_ROOT)/out/linters
38+
curl -sSfL -o $@.tar.xz https://github.com/koalaman/shellcheck/releases/download/$(SHELLCHECK_VERSION)/shellcheck-$(SHELLCHECK_VERSION).$(LINT_OS_LOWER).$(LINT_ARCH).tar.xz \
39+
|| echo "Unable to fetch shellcheck for $(LINT_OS)/$(LINT_ARCH): falling back to locally install"
40+
test -f $@.tar.xz \
41+
&& tar -C $(LINT_ROOT)/out/linters -xJf $@.tar.xz \
42+
&& mv $(LINT_ROOT)/out/linters/shellcheck-$(SHELLCHECK_VERSION)/shellcheck $@ \
43+
|| printf "#!/usr/bin/env shellcheck\n" > $@
44+
chmod u+x $@
45+
46+
LINTERS += shellcheck-lint
47+
shellcheck-lint: $(SHELLCHECK_BIN)
48+
$(SHELLCHECK_BIN) $(shell find . -name "*.sh")
49+
50+
FIXERS += shellcheck-fix
51+
shellcheck-fix: $(SHELLCHECK_BIN)
52+
$(SHELLCHECK_BIN) $(shell find . -name "*.sh") -f diff | { read -t 1 line || exit 0; { echo "$$line" && cat; } | git apply -p2; }
53+
3454
GOLANGCI_LINT_CONFIG := $(LINT_ROOT)/.golangci.yml
35-
GOLANGCI_LINT_VERSION ?= v2.5.0
55+
GOLANGCI_LINT_VERSION ?= v2.7.2
3656
GOLANGCI_LINT_BIN := $(LINT_ROOT)/out/linters/golangci-lint-$(GOLANGCI_LINT_VERSION)-$(LINT_ARCH)
3757
$(GOLANGCI_LINT_BIN):
3858
mkdir -p $(LINT_ROOT)/out/linters
@@ -61,6 +81,32 @@ LINTERS += yamllint-lint
6181
yamllint-lint: $(YAMLLINT_BIN)
6282
PYTHONPATH=$(YAMLLINT_ROOT)/dist $(YAMLLINT_ROOT)/dist/bin/yamllint .
6383

84+
BIOME_VERSION ?= 2.3.8
85+
BIOME_BIN := $(LINT_ROOT)/out/linters/biome-$(BIOME_VERSION)-$(LINT_ARCH)
86+
BIOME_CONFIG := $(LINT_ROOT)/biome.json
87+
88+
# Map architecture names for Biome downloads
89+
BIOME_ARCH := $(LINT_ARCH)
90+
ifeq ($(LINT_ARCH),x86_64)
91+
BIOME_ARCH := x64
92+
endif
93+
94+
$(BIOME_BIN):
95+
mkdir -p $(LINT_ROOT)/out/linters
96+
rm -rf $(LINT_ROOT)/out/linters/biome-*
97+
curl -sSfL -o $@ https://github.com/biomejs/biome/releases/download/%40biomejs%2Fbiome%40$(BIOME_VERSION)/biome-$(LINT_OS_LOWER)-$(BIOME_ARCH) \
98+
|| echo "Unable to fetch biome for $(LINT_OS_LOWER)/$(BIOME_ARCH), falling back to local install"
99+
test -f $@ || printf "#!/usr/bin/env biome\n" > $@
100+
chmod u+x $@
101+
102+
LINTERS += biome-lint
103+
biome-lint: $(BIOME_BIN)
104+
$(BIOME_BIN) check --config-path=$(BIOME_CONFIG) .
105+
106+
FIXERS += biome-fix
107+
biome-fix: $(BIOME_BIN)
108+
$(BIOME_BIN) check --write --config-path=$(BIOME_CONFIG) .
109+
64110
.PHONY: _lint $(LINTERS)
65111
_lint:
66112
@exit_code=0; \
@@ -79,6 +125,7 @@ fix:
79125

80126
# END: lint-install .
81127

128+
82129
.PHONY: deploy
83130
deploy:
84131
./hacks/deploy.sh cmd/server/

cmd/prcost/main.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -590,19 +590,13 @@ func printEfficiency(breakdown *cost.Breakdown) {
590590

591591
fmt.Println(" ┌─────────────────────────────────────────────────────────────┐")
592592
headerText := fmt.Sprintf("DEVELOPMENT EFFICIENCY: %s (%.1f%%) - %s", grade, efficiencyPct, message)
593-
padding := 60 - len(headerText)
594-
if padding < 0 {
595-
padding = 0
596-
}
593+
padding := max(60-len(headerText), 0)
597594
fmt.Printf(" │ %s%*s│\n", headerText, padding, "")
598595
fmt.Println(" └─────────────────────────────────────────────────────────────┘")
599596

600597
fmt.Println(" ┌─────────────────────────────────────────────────────────────┐")
601598
velocityHeader := fmt.Sprintf("MERGE VELOCITY: %s (%s) - %s", velocityGrade, formatTimeUnit(breakdown.PRDuration), velocityMessage)
602-
velPadding := 60 - len(velocityHeader)
603-
if velPadding < 0 {
604-
velPadding = 0
605-
}
599+
velPadding := max(60-len(velocityHeader), 0)
606600
fmt.Printf(" │ %s%*s│\n", velocityHeader, velPadding, "")
607601
fmt.Println(" └─────────────────────────────────────────────────────────────┘")
608602

cmd/prcost/repository.go

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ import (
1515
// Uses library functions from pkg/github and pkg/cost for fetching, sampling,
1616
// and extrapolation - all functionality is available to external clients.
1717
func analyzeRepository(ctx context.Context, owner, repo string, sampleSize, days int, cfg cost.Config, token, dataSource string) error {
18+
// Create GitHub client without caching (for CLI)
19+
client := github.NewClientWithoutCache()
20+
1821
// Calculate since date
1922
since := time.Now().AddDate(0, 0, -days)
2023

2124
// Fetch all PRs modified since the date using library function
22-
prs, err := github.FetchPRsFromRepo(ctx, owner, repo, since, token, nil)
25+
prs, err := client.FetchPRsFromRepo(ctx, owner, repo, since, token, nil)
2326
if err != nil {
2427
return fmt.Errorf("failed to fetch PRs: %w", err)
2528
}
@@ -59,14 +62,14 @@ func analyzeRepository(ctx context.Context, owner, repo string, sampleSize, days
5962
}
6063

6164
// Convert samples to PRSummaryInfo format
62-
var summaries []cost.PRSummaryInfo
63-
for _, pr := range samples {
64-
summaries = append(summaries, cost.PRSummaryInfo{
65-
Owner: pr.Owner,
66-
Repo: pr.Repo,
67-
Number: pr.Number,
68-
UpdatedAt: pr.UpdatedAt,
69-
})
65+
summaries := make([]cost.PRSummaryInfo, len(samples))
66+
for i := range samples {
67+
summaries[i] = cost.PRSummaryInfo{
68+
Owner: samples[i].Owner,
69+
Repo: samples[i].Repo,
70+
Number: samples[i].Number,
71+
UpdatedAt: samples[i].UpdatedAt,
72+
}
7073
}
7174

7275
// Create fetcher
@@ -93,25 +96,25 @@ func analyzeRepository(ctx context.Context, owner, repo string, sampleSize, days
9396
totalAuthors := github.CountUniqueAuthors(prs)
9497

9598
// Query for actual count of open PRs (not extrapolated from samples)
96-
openPRCount, err := github.CountOpenPRsInRepo(ctx, owner, repo, token)
99+
openPRCount, err := client.CountOpenPRsInRepo(ctx, owner, repo, token)
97100
if err != nil {
98101
slog.Warn("Failed to count open PRs, using 0", "error", err)
99102
openPRCount = 0
100103
}
101104

102105
// Convert PRSummary to PRSummaryInfo for extrapolation
103106
prSummaryInfos := make([]cost.PRSummaryInfo, len(prs))
104-
for i, pr := range prs {
107+
for i := range prs {
105108
prSummaryInfos[i] = cost.PRSummaryInfo{
106-
Owner: pr.Owner,
107-
Repo: pr.Repo,
108-
Author: pr.Author,
109-
AuthorType: pr.AuthorType,
110-
CreatedAt: pr.CreatedAt,
111-
UpdatedAt: pr.UpdatedAt,
112-
ClosedAt: pr.ClosedAt,
113-
Merged: pr.Merged,
114-
State: pr.State,
109+
Owner: prs[i].Owner,
110+
Repo: prs[i].Repo,
111+
Author: prs[i].Author,
112+
AuthorType: prs[i].AuthorType,
113+
CreatedAt: prs[i].CreatedAt,
114+
UpdatedAt: prs[i].UpdatedAt,
115+
ClosedAt: prs[i].ClosedAt,
116+
Merged: prs[i].Merged,
117+
State: prs[i].State,
115118
}
116119
}
117120

@@ -128,13 +131,16 @@ func analyzeRepository(ctx context.Context, owner, repo string, sampleSize, days
128131
// Uses library functions from pkg/github and pkg/cost for fetching, sampling,
129132
// and extrapolation - all functionality is available to external clients.
130133
func analyzeOrganization(ctx context.Context, org string, sampleSize, days int, cfg cost.Config, token, dataSource string) error {
134+
// Create GitHub client without caching (for CLI)
135+
client := github.NewClientWithoutCache()
136+
131137
slog.Info("Fetching PR list from organization")
132138

133139
// Calculate since date
134140
since := time.Now().AddDate(0, 0, -days)
135141

136142
// Fetch all PRs across the org modified since the date using library function
137-
prs, err := github.FetchPRsFromOrg(ctx, org, since, token, nil)
143+
prs, err := client.FetchPRsFromOrg(ctx, org, since, token, nil)
138144
if err != nil {
139145
return fmt.Errorf("failed to fetch PRs: %w", err)
140146
}
@@ -174,14 +180,14 @@ func analyzeOrganization(ctx context.Context, org string, sampleSize, days int,
174180
}
175181

176182
// Convert samples to PRSummaryInfo format
177-
var summaries []cost.PRSummaryInfo
178-
for _, pr := range samples {
179-
summaries = append(summaries, cost.PRSummaryInfo{
180-
Owner: pr.Owner,
181-
Repo: pr.Repo,
182-
Number: pr.Number,
183-
UpdatedAt: pr.UpdatedAt,
184-
})
183+
summaries := make([]cost.PRSummaryInfo, len(samples))
184+
for i := range samples {
185+
summaries[i] = cost.PRSummaryInfo{
186+
Owner: samples[i].Owner,
187+
Repo: samples[i].Repo,
188+
Number: samples[i].Number,
189+
UpdatedAt: samples[i].UpdatedAt,
190+
}
185191
}
186192

187193
// Create fetcher
@@ -208,7 +214,7 @@ func analyzeOrganization(ctx context.Context, org string, sampleSize, days int,
208214
totalAuthors := github.CountUniqueAuthors(prs)
209215

210216
// Count open PRs across the entire organization with a single query
211-
totalOpenPRs, err := github.CountOpenPRsInOrg(ctx, org, token)
217+
totalOpenPRs, err := client.CountOpenPRsInOrg(ctx, org, token)
212218
if err != nil {
213219
slog.Warn("Failed to count open PRs in organization, using 0", "error", err)
214220
totalOpenPRs = 0
@@ -217,17 +223,17 @@ func analyzeOrganization(ctx context.Context, org string, sampleSize, days int,
217223

218224
// Convert PRSummary to PRSummaryInfo for extrapolation
219225
prSummaryInfos := make([]cost.PRSummaryInfo, len(prs))
220-
for i, pr := range prs {
226+
for i := range prs {
221227
prSummaryInfos[i] = cost.PRSummaryInfo{
222-
Owner: pr.Owner,
223-
Repo: pr.Repo,
224-
Author: pr.Author,
225-
AuthorType: pr.AuthorType,
226-
CreatedAt: pr.CreatedAt,
227-
UpdatedAt: pr.UpdatedAt,
228-
ClosedAt: pr.ClosedAt,
229-
Merged: pr.Merged,
230-
State: pr.State,
228+
Owner: prs[i].Owner,
229+
Repo: prs[i].Repo,
230+
Author: prs[i].Author,
231+
AuthorType: prs[i].AuthorType,
232+
CreatedAt: prs[i].CreatedAt,
233+
UpdatedAt: prs[i].UpdatedAt,
234+
ClosedAt: prs[i].ClosedAt,
235+
Merged: prs[i].Merged,
236+
State: prs[i].State,
231237
}
232238
}
233239

cmd/server/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ func main() {
107107

108108
// Create server
109109
prcostServer := server.New()
110+
if prcostServer == nil {
111+
logger.ErrorContext(ctx, "failed to initialize server (check cache configuration)")
112+
os.Exit(1)
113+
}
110114
prcostServer.SetCommit(GitCommit)
111115
prcostServer.SetCORSConfig(*corsOrigins, *allowAllCors)
112116
prcostServer.SetRateLimit(*rateLimit, *rateBurst)

go.mod

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
module github.com/codeGROOVE-dev/prcost
22

3-
go 1.25.3
3+
go 1.25.4
44

55
require (
6-
github.com/codeGROOVE-dev/ds9 v0.6.0
6+
github.com/codeGROOVE-dev/fido v1.10.0
7+
github.com/codeGROOVE-dev/fido/pkg/store/cloudrun v1.10.0
78
github.com/codeGROOVE-dev/gsm v0.0.0-20251019065141-833fe2363d22
8-
github.com/codeGROOVE-dev/prx v0.0.0-20251030022101-ff906928a1e4
9-
github.com/codeGROOVE-dev/turnclient v0.0.0-20251030022425-bc3b14acf75e
9+
github.com/codeGROOVE-dev/prx v0.0.0-20251109164430-90488144076d
10+
github.com/codeGROOVE-dev/turnclient v0.0.0-20251107215141-ee43672b3dc7
1011
golang.org/x/time v0.14.0
1112
)
1213

13-
require github.com/codeGROOVE-dev/retry v1.3.0 // indirect
14+
require (
15+
github.com/codeGROOVE-dev/ds9 v0.8.0 // indirect
16+
github.com/codeGROOVE-dev/fido/pkg/store/compress v1.10.0 // indirect
17+
github.com/codeGROOVE-dev/fido/pkg/store/datastore v1.10.0 // indirect
18+
github.com/codeGROOVE-dev/fido/pkg/store/localfs v1.10.0 // indirect
19+
github.com/codeGROOVE-dev/retry v1.3.0 // indirect
20+
github.com/klauspost/compress v1.18.2 // indirect
21+
github.com/puzpuzpuz/xsync/v4 v4.2.0 // indirect
22+
)

go.sum

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1-
github.com/codeGROOVE-dev/ds9 v0.6.0 h1:JG7vBH17UAKaVoeQilrIvA1I0fg3iNbdUMBSDS7ixgI=
2-
github.com/codeGROOVE-dev/ds9 v0.6.0/go.mod h1:0UDipxF1DADfqM5GtjefgB2u+EXdDgOKmxVvrSGLHoM=
1+
github.com/codeGROOVE-dev/ds9 v0.8.0 h1:A23VvL1YzUBZyXNYmF5u0R6nPcxQitPeLo8FFk6OiUs=
2+
github.com/codeGROOVE-dev/ds9 v0.8.0/go.mod h1:0UDipxF1DADfqM5GtjefgB2u+EXdDgOKmxVvrSGLHoM=
3+
github.com/codeGROOVE-dev/fido v1.10.0 h1:i4Wb6LDd5nD/4Fnp47KAVUVhG1O1mN5jSRbCYPpBYjw=
4+
github.com/codeGROOVE-dev/fido v1.10.0/go.mod h1:/mqfMeKCTYTGt/Y0cWm6gh8gYBKG1w8xBsTDmu+A/pU=
5+
github.com/codeGROOVE-dev/fido/pkg/store/cloudrun v1.10.0 h1:0Wvs3JE+TI8GsEkh0jg0SglyFyIkBewPSl0PTUSVqEo=
6+
github.com/codeGROOVE-dev/fido/pkg/store/cloudrun v1.10.0/go.mod h1:MaxO6QGv89FrZB1D+stiZjRcbaMUfiw7yYGkaqOoJ2k=
7+
github.com/codeGROOVE-dev/fido/pkg/store/compress v1.10.0 h1:W3AYtR6eyPHQ8QhTsuqjNZYWk/Fev0cJiAiuw04uhlk=
8+
github.com/codeGROOVE-dev/fido/pkg/store/compress v1.10.0/go.mod h1:0hFYQ8Y6jfrYuJb8eBimYz66tg7DDuVWbZqaI944LQM=
9+
github.com/codeGROOVE-dev/fido/pkg/store/datastore v1.10.0 h1:vCsLeESGQvW7F8pJJimZhRjzWmrQg1WZgT22om9fT/Q=
10+
github.com/codeGROOVE-dev/fido/pkg/store/datastore v1.10.0/go.mod h1:LtpO9TUi92D7uLBXJu+kLWVpRmEtVRAWVB2EdzNU0JQ=
11+
github.com/codeGROOVE-dev/fido/pkg/store/localfs v1.10.0 h1:oaPwuHHBuzhsWnPm7UCxgwjz7+jG3O0JenSSgPSwqv8=
12+
github.com/codeGROOVE-dev/fido/pkg/store/localfs v1.10.0/go.mod h1:zUGzODSWykosAod0IHycxdxUOMcd2eVqd6eUdOsU73E=
313
github.com/codeGROOVE-dev/gsm v0.0.0-20251019065141-833fe2363d22 h1:gtN3rOc6YspO646BkcOxBhPjEqKUz+jl175jIqglfDg=
414
github.com/codeGROOVE-dev/gsm v0.0.0-20251019065141-833fe2363d22/go.mod h1:KV+w19ubP32PxZPE1hOtlCpTaNpF0Bpb32w5djO8UTg=
5-
github.com/codeGROOVE-dev/prx v0.0.0-20251030022101-ff906928a1e4 h1:DSuoUwP3oyR4cHrX0cUh9c7CtYjXNIcyCmqpIwHilIU=
6-
github.com/codeGROOVE-dev/prx v0.0.0-20251030022101-ff906928a1e4/go.mod h1:FEy3gz9IYDXWnKWkoDSL+pWu6rujxbBSrF4w5A8QSK0=
15+
github.com/codeGROOVE-dev/prx v0.0.0-20251109164430-90488144076d h1:KKt93PVYR9Uga8uLPq0HoNlXVW3BTPHGBBxEb5YBxf4=
16+
github.com/codeGROOVE-dev/prx v0.0.0-20251109164430-90488144076d/go.mod h1:FEy3gz9IYDXWnKWkoDSL+pWu6rujxbBSrF4w5A8QSK0=
717
github.com/codeGROOVE-dev/retry v1.3.0 h1:/+ipAWRJLL6y1R1vprYo0FSjSBvH6fE5j9LKXjpD54g=
818
github.com/codeGROOVE-dev/retry v1.3.0/go.mod h1:8OgefgV1XP7lzX2PdKlCXILsYKuz6b4ZpHa/20iLi8E=
9-
github.com/codeGROOVE-dev/turnclient v0.0.0-20251030022425-bc3b14acf75e h1:WXHdC8o5KmP5CwkQRiGVywYzsj93fjkRPq7clhfZPq0=
10-
github.com/codeGROOVE-dev/turnclient v0.0.0-20251030022425-bc3b14acf75e/go.mod h1:dVS3MlJDgL6WkfurJAyS7I9Fe1yxxoxxarjVifY5bIo=
19+
github.com/codeGROOVE-dev/turnclient v0.0.0-20251107215141-ee43672b3dc7 h1:183q0bj2y/9hh/K0HZvDXI6sG7liYSRcQVgFx0GY+UA=
20+
github.com/codeGROOVE-dev/turnclient v0.0.0-20251107215141-ee43672b3dc7/go.mod h1:dVS3MlJDgL6WkfurJAyS7I9Fe1yxxoxxarjVifY5bIo=
21+
github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk=
22+
github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
23+
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
24+
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
25+
github.com/puzpuzpuz/xsync/v4 v4.2.0 h1:dlxm77dZj2c3rxq0/XNvvUKISAmovoXF4a4qM6Wvkr0=
26+
github.com/puzpuzpuz/xsync/v4 v4.2.0/go.mod h1:VJDmTCJMBt8igNxnkQd86r+8KUeN1quSfNKu5bLYFQo=
1127
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
1228
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=

hacks/debug-sessions/main.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func main() {
6464
events := make([]cost.ParticipantEvent, len(authorEvents))
6565
copy(events, authorEvents)
6666
// Sort manually
67-
for i := 0; i < len(events); i++ {
67+
for i := range events {
6868
for j := i + 1; j < len(events); j++ {
6969
if events[j].Timestamp.Before(events[i].Timestamp) {
7070
events[i], events[j] = events[j], events[i]
@@ -105,10 +105,7 @@ func main() {
105105
// Gaps between events
106106
for j := start; j < end; j++ {
107107
gap := events[j+1].Timestamp.Sub(events[j].Timestamp)
108-
counted := gap
109-
if gap > eventDur {
110-
counted = eventDur
111-
}
108+
counted := min(gap, eventDur)
112109
totalGitHub += counted
113110
fmt.Printf(" Gap %d->%d: %v (actual: %v)\n", j-start, j-start+1, counted, gap)
114111
}

hacks/test-sessions/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func main() {
4040
copy(sorted, authorEvents)
4141

4242
// Simple sort
43-
for i := 0; i < len(sorted); i++ {
43+
for i := range sorted {
4444
for j := i + 1; j < len(sorted); j++ {
4545
if sorted[j].Timestamp.Before(sorted[i].Timestamp) {
4646
sorted[i], sorted[j] = sorted[j], sorted[i]

0 commit comments

Comments
 (0)