Skip to content

Commit 05f5846

Browse files
ci: run go fix as part of the lint workflow
1 parent 77b3bdb commit 05f5846

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ jobs:
2020
- uses: actions/setup-go@v6
2121
with:
2222
go-version: ${{ matrix.go }}
23+
- name: Run go fix
24+
if: (success() || failure()) && matrix.go == '1.25.x'
25+
run: go fix -diff ./...
2326
- name: golangci-lint
27+
if: success() || failure() # run this step even if the previous one failed
2428
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
2529
with:
2630
version: v2.4.0

qpack_test.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,11 @@ func TestEncodeDecode(t *testing.T) {
4141
// replace one character by a random character at a random position
4242
func replaceRandomCharacter(s string) string {
4343
pos := rand.IntN(len(s))
44-
new := s[:pos]
4544
for {
46-
if c := randomString(1); c != string(s[pos]) {
47-
new += c
48-
break
45+
if c := randomString(1); c != s[pos:pos+1] {
46+
return s[:pos] + c + s[pos+1:]
4947
}
5048
}
51-
new += s[pos+1:]
52-
return new
5349
}
5450

5551
func check(t *testing.T, encoded []byte, hf HeaderField) {

0 commit comments

Comments
 (0)