Skip to content

Commit 1e22633

Browse files
authored
github/workflow: update to go1.19 (#142)
* github/workflow: update to go1.19 * github/workflows: run gofmt only go1.19 * msgpack,nvim: run gofmt with go1.19
1 parent 88b4e2e commit 1e22633

File tree

9 files changed

+379
-254
lines changed

9 files changed

+379
-254
lines changed

Diff for: .github/workflows/benchmark.yml

+3-22
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ jobs:
1717
strategy:
1818
matrix:
1919
os:
20-
- ubuntu-20.04 # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
20+
- ubuntu-22.04 # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
2121
go-version:
22-
- 1.18.x
22+
- 1.19.x
23+
2324
runs-on: ${{ matrix.os }}
2425

2526
steps:
@@ -36,26 +37,6 @@ jobs:
3637
- name: Checkout code
3738
uses: actions/checkout@v3
3839

39-
- name: Cache Go module and build cache
40-
uses: actions/cache@v3
41-
with:
42-
key: ${{ env.OS }}-go-${{ hashFiles('**/go.sum') }}
43-
path: |
44-
~/go/pkg/mod # Module download cache
45-
~/.cache/go-build # Build cache (Linux)
46-
restore-keys: |
47-
${{ env.OS }}-go-
48-
49-
- name: Cache nvim binary for linux and darwin
50-
uses: actions/cache@v3
51-
id: cache-nvim
52-
with:
53-
key: ${{ env.OS }}-nvim-${{ hashFiles('~/nvim/bin/nvim') }}
54-
path: |
55-
~/nvim
56-
restore-keys: |
57-
${{ env.OS }}-nvim-
58-
5940
- name: Install nvim binary
6041
uses: rhysd/action-setup-vim@v1
6142
if: steps.cache-nvim.outputs.cache-hit != 'true'

Diff for: .github/workflows/codeql.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ on:
1313
jobs:
1414
analyze:
1515
name: Analyze
16-
runs-on: ubuntu-20.04
16+
runs-on:
17+
- ubuntu-22.04 # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
1718

1819
permissions:
1920
actions: read

Diff for: .github/workflows/test.yml

+10-19
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
strategy:
2323
matrix:
2424
os:
25-
- ubuntu-20.04 # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
26-
- macos-12 # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md
27-
- windows-2022 # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md
25+
- ubuntu-22.04 # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md
26+
- macos-12 # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
27+
- windows-2022 # https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md
2828
go-version:
29-
- 1.16.x
3029
- 1.17.x
3130
- 1.18.x
31+
- 1.19.x
3232
neovim-version:
3333
- v0.7.0
3434
- nightly
@@ -51,35 +51,26 @@ jobs:
5151
- name: Checkout code
5252
uses: actions/checkout@v3
5353

54-
- name: Cache Go module and build cache
55-
uses: actions/cache@v3
56-
with:
57-
key: go-${{ env.OS }}-${{ hashFiles('**/go.mod') }}
58-
path: |
59-
~/go/pkg/mod
60-
~/.cache/go-build
61-
~/Library/Caches/go-build
62-
'%LocalAppData%\go-build'
63-
restore-keys: |
64-
go-${{ env.OS }}-${{ hashFiles('**/go.mod') }}
65-
6654
- name: Install neovim binary
6755
uses: rhysd/action-setup-vim@v1
6856
with:
6957
neovim: true
7058
version: ${{ matrix.neovim-version }}
7159

7260
- name: gofmt
73-
if: ${{ env.OS != 'windows' }}
61+
if: matrix.go-version == '1.19.x' && env.OS != 'windows'
7462
run: |
7563
diff -u <(echo -n) <(gofmt -s -d .)
7664
77-
- name: Test and vet
65+
- name: go vet
7866
run: |
7967
go vet ./...
68+
69+
- name: Test and take a coverage
70+
run: |
8071
go test -v -race -count=1 -covermode=atomic -coverpkg=./... -coverprofile=coverage.out ./...
8172
82-
- uses: codecov/codecov-action@v2
73+
- uses: codecov/codecov-action@v3
8374
with:
8475
file: coverage.out
8576
flags: ${{ env.OS }}-${{ env.GO_VERSION }}-${{ env.NVIM_VERSION }}

Diff for: msgpack/encode.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ func encodeUnsupportedType(e *Encoder, v reflect.Value) {
3131
//
3232
// Otherwise, Encode uses the following type-dependent default encodings:
3333
//
34-
// Go Type MessagePack Type
35-
// bool true or false
36-
// float32, float64 float64
37-
// string string
38-
// []byte binary
39-
// slices, arrays array
40-
// struct, map map
34+
// Go Type MessagePack Type
35+
// bool true or false
36+
// float32, float64 float64
37+
// string string
38+
// []byte binary
39+
// slices, arrays array
40+
// struct, map map
4141
//
4242
// Struct values encode as maps or arrays. If any struct field tag specifies
4343
// the "array" option, then the struct is encoded as an array. Otherwise, the

Diff for: msgpack/msgpack_test.go

+22-22
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ import (
1313

1414
// pack packs the values vs and returns the result.
1515
//
16-
// Go Type Encoder method
17-
// nil PackNil
18-
// bool PackBool
19-
// int64 PackInt
20-
// uint64 PackUint
21-
// float64 PackFloat
22-
// arrayLen PackArrayLen
23-
// mapLen PackMapLen
24-
// string PackString(s, false)
25-
// []byte PackBytes(s, true)
26-
// extension PackExtension(k, d)
16+
// Go Type Encoder method
17+
// nil PackNil
18+
// bool PackBool
19+
// int64 PackInt
20+
// uint64 PackUint
21+
// float64 PackFloat
22+
// arrayLen PackArrayLen
23+
// mapLen PackMapLen
24+
// string PackString(s, false)
25+
// []byte PackBytes(s, true)
26+
// extension PackExtension(k, d)
2727
func pack(vs ...interface{}) ([]byte, error) {
2828
var buf bytes.Buffer
2929
enc := NewEncoder(&buf)
@@ -65,17 +65,17 @@ func pack(vs ...interface{}) ([]byte, error) {
6565

6666
// unpack unpacks a byte slice to the following types.
6767
//
68-
// Type Go
69-
// Nil nil
70-
// Bool bool
71-
// Int int
72-
// Uint int
73-
// Float float64
74-
// ArrayLen arrayLen
75-
// MapLen mapLen
76-
// String string
77-
// Binary []byte
78-
// Extension extension
68+
// Type Go
69+
// Nil nil
70+
// Bool bool
71+
// Int int
72+
// Uint int
73+
// Float float64
74+
// ArrayLen arrayLen
75+
// MapLen mapLen
76+
// String string
77+
// Binary []byte
78+
// Extension extension
7979
//
8080
// This function is not suitable for unpack tests because the integer and float
8181
// types are mapped to int and float64 respectively.

0 commit comments

Comments
 (0)