Skip to content

Commit 071689e

Browse files
authored
Test with Go 1.19, upgrade golangci-lint (#35)
The previous version of the golangci-lint action would install its own version of Go, which eventually conflicted with the old pinned version of the linter I was using. Upgrade the action to avoid this, but also update Go and the linter while I'm here.
1 parent 7593039 commit 071689e

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

.github/workflows/go.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ jobs:
99
name: Verify
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Set up Go 1.16
13-
uses: actions/setup-go@v2
12+
- name: Set up Go 1.19
13+
uses: actions/setup-go@v3
1414
with:
15-
go-version: 1.16
15+
go-version: 1.19
1616

1717
- name: Check out code into the Go module directory
1818
uses: actions/checkout@v2
1919

2020
- name: Lint
21-
uses: golangci/golangci-lint-action@v2
21+
uses: golangci/golangci-lint-action@v3
2222
with:
23-
version: v1.28
23+
version: v1.49
2424

2525
- name: Test
2626
run: go test -v ./...

gitdiff/apply.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ import (
1313
// Users can test if an error was caused by a conflict by using errors.Is with
1414
// an empty Conflict:
1515
//
16-
// if errors.Is(err, &Conflict{}) {
17-
// // handle conflict
18-
// }
19-
//
16+
// if errors.Is(err, &Conflict{}) {
17+
// // handle conflict
18+
// }
2019
type Conflict struct {
2120
msg string
2221
}

gitdiff/apply_binary.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func applyBinaryDeltaFragment(dst io.Writer, src io.ReaderAt, frag []byte) error
115115
// readBinaryDeltaSize reads a variable length size from a delta-encoded binary
116116
// fragment, returing the size and the unused data. Data is encoded as:
117117
//
118-
// [[1xxxxxxx]...] [0xxxxxxx]
118+
// [[1xxxxxxx]...] [0xxxxxxx]
119119
//
120120
// in little-endian order, with 7 bits of the value per byte.
121121
func readBinaryDeltaSize(d []byte) (size int64, rest []byte) {
@@ -134,7 +134,7 @@ func readBinaryDeltaSize(d []byte) (size int64, rest []byte) {
134134
// fragment, returning the amount of data written and the usused part of the
135135
// fragment. An add operation takes the form:
136136
//
137-
// [0xxxxxx][[data1]...]
137+
// [0xxxxxx][[data1]...]
138138
//
139139
// where the lower seven bits of the opcode is the number of data bytes
140140
// following the opcode. See also pack-format.txt in the Git source.
@@ -151,7 +151,7 @@ func applyBinaryDeltaAdd(w io.Writer, op byte, delta []byte) (n int64, rest []by
151151
// fragment, returing the amount of data written and the unused part of the
152152
// fragment. A copy operation takes the form:
153153
//
154-
// [1xxxxxxx][offset1][offset2][offset3][offset4][size1][size2][size3]
154+
// [1xxxxxxx][offset1][offset2][offset3][offset4][size1][size2][size3]
155155
//
156156
// where the lower seven bits of the opcode determine which non-zero offset and
157157
// size bytes are present in little-endian order: if bit 0 is set, offset1 is

gitdiff/apply_text.go

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
//
1111
// By default, TextApplier operates in "strict" mode, where fragment content
1212
// and positions must exactly match those of the source.
13-
//
1413
type TextApplier struct {
1514
dst io.Writer
1615
src io.ReaderAt

gitdiff/testdata/apply/bin.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//+build ignore
1+
//go:build ignore
22

33
// bin.go is a helper CLI to manipulate binary diff data for testing purposes.
44
// It can decode patches generated by git using the standard parsing functions

0 commit comments

Comments
 (0)