Merge pull request #3850 from lbausch/go1.19

Update tests to Go 1.19
This commit is contained in:
MichaelEischer 2022-08-07 14:56:17 +02:00 committed by GitHub
commit 9ad3ad5972
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 382 additions and 376 deletions

View File

@ -9,7 +9,7 @@ on:
pull_request: pull_request:
env: env:
latest_go: "1.18.x" latest_go: "1.19.x"
GO111MODULE: on GO111MODULE: on
jobs: jobs:
@ -19,24 +19,30 @@ jobs:
# list of jobs to run: # list of jobs to run:
include: include:
- job_name: Windows - job_name: Windows
go: 1.18.x go: 1.19.x
os: windows-latest os: windows-latest
install_verb: install install_verb: install
- job_name: macOS - job_name: macOS
go: 1.18.x go: 1.19.x
os: macOS-latest os: macOS-latest
test_fuse: false test_fuse: false
install_verb: install install_verb: install
- job_name: Linux - job_name: Linux
go: 1.18.x go: 1.19.x
os: ubuntu-latest os: ubuntu-latest
test_cloud_backends: true test_cloud_backends: true
test_fuse: true test_fuse: true
check_changelog: true check_changelog: true
install_verb: install install_verb: install
- job_name: Linux
go: 1.18.x
os: ubuntu-latest
test_fuse: true
install_verb: install
- job_name: Linux - job_name: Linux
go: 1.17.x go: 1.17.x
os: ubuntu-latest os: ubuntu-latest
@ -260,7 +266,7 @@ jobs:
uses: golangci/golangci-lint-action@v2 uses: golangci/golangci-lint-action@v2
with: with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.45 version: v1.48
# Optional: show only new issues if it's a pull request. The default value is `false`. # Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true only-new-issues: true
args: --verbose --timeout 5m args: --verbose --timeout 5m

View File

@ -190,7 +190,7 @@ type KeepReason struct {
// according to the policy p. list is sorted in the process. reasons contains // according to the policy p. list is sorted in the process. reasons contains
// the reasons to keep each snapshot, it is in the same order as keep. // the reasons to keep each snapshot, it is in the same order as keep.
func ApplyPolicy(list Snapshots, p ExpirePolicy) (keep, remove Snapshots, reasons []KeepReason) { func ApplyPolicy(list Snapshots, p ExpirePolicy) (keep, remove Snapshots, reasons []KeepReason) {
sort.Sort(list) sort.Stable(list)
if p.Empty() { if p.Empty() {
for _, sn := range list { for _, sn := range list {

View File

@ -150,27 +150,6 @@
"tree": null, "tree": null,
"paths": null "paths": null
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
@ -185,6 +164,27 @@
"bar" "bar"
] ]
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-20T10:20:30Z", "time": "2015-10-20T10:20:30Z",
"tree": null, "tree": null,
@ -911,39 +911,6 @@
], ],
"counters": {} "counters": {}
}, },
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
"matches": [
"policy is empty"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"policy is empty"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
@ -970,6 +937,39 @@
], ],
"counters": {} "counters": {}
}, },
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"policy is empty"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
"matches": [
"policy is empty"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2015-10-20T10:20:30Z", "time": "2015-10-20T10:20:30Z",

View File

@ -1,5 +1,23 @@
{ {
"keep": [ "keep": [
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
@ -12,24 +30,6 @@
"bar" "bar"
] ]
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2014-11-15T10:20:30Z", "time": "2014-11-15T10:20:30Z",
"tree": null, "tree": null,
@ -153,6 +153,36 @@
} }
], ],
"reasons": [ "reasons": [
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo]"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo]"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
@ -171,36 +201,6 @@
], ],
"counters": {} "counters": {}
}, },
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo]"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo]"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2014-11-15T10:20:30Z", "time": "2014-11-15T10:20:30Z",

View File

@ -1,5 +1,23 @@
{ {
"keep": [ "keep": [
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
@ -12,24 +30,6 @@
"bar" "bar"
] ]
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2014-11-15T10:20:30Z", "time": "2014-11-15T10:20:30Z",
"tree": null, "tree": null,
@ -41,6 +41,36 @@
} }
], ],
"reasons": [ "reasons": [
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo, bar]"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo, bar]"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
@ -59,36 +89,6 @@
], ],
"counters": {} "counters": {}
}, },
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo, bar]"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo, bar]"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2014-11-15T10:20:30Z", "time": "2014-11-15T10:20:30Z",

View File

@ -1,5 +1,23 @@
{ {
"keep": [ "keep": [
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
@ -12,24 +30,6 @@
"bar" "bar"
] ]
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2014-11-15T10:20:30Z", "time": "2014-11-15T10:20:30Z",
"tree": null, "tree": null,
@ -161,6 +161,38 @@
} }
], ],
"reasons": [ "reasons": [
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo]",
"has tags [bar]"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo]",
"has tags [bar]"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
@ -180,38 +212,6 @@
], ],
"counters": {} "counters": {}
}, },
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo]",
"has tags [bar]"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"has tags [foo]",
"has tags [bar]"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2014-11-15T10:20:30Z", "time": "2014-11-15T10:20:30Z",

View File

@ -150,27 +150,6 @@
"tree": null, "tree": null,
"paths": null "paths": null
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
@ -185,6 +164,27 @@
"bar" "bar"
] ]
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-20T10:20:30Z", "time": "2015-10-20T10:20:30Z",
"tree": null, "tree": null,
@ -662,39 +662,6 @@
], ],
"counters": {} "counters": {}
}, },
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
"matches": [
"within 1y1m1d"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"within 1y1m1d"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
@ -721,6 +688,39 @@
], ],
"counters": {} "counters": {}
}, },
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"within 1y1m1d"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
"matches": [
"within 1y1m1d"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2015-10-20T10:20:30Z", "time": "2015-10-20T10:20:30Z",

View File

@ -150,27 +150,6 @@
"tree": null, "tree": null,
"paths": null "paths": null
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
@ -185,6 +164,27 @@
"bar" "bar"
] ]
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-20T10:20:30Z", "time": "2015-10-20T10:20:30Z",
"tree": null, "tree": null,
@ -691,39 +691,6 @@
], ],
"counters": {} "counters": {}
}, },
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
"matches": [
"within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"within 1y2m3d3h"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
@ -750,6 +717,39 @@
], ],
"counters": {} "counters": {}
}, },
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
"matches": [
"within 1y2m3d3h"
],
"counters": {}
},
{
"snapshot": {
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
"matches": [
"within 1y2m3d3h"
],
"counters": {}
},
{ {
"snapshot": { "snapshot": {
"time": "2015-10-20T10:20:30Z", "time": "2015-10-20T10:20:30Z",

View File

@ -150,27 +150,6 @@
"tree": null, "tree": null,
"paths": null "paths": null
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
@ -185,6 +164,27 @@
"bar" "bar"
] ]
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-20T10:20:30Z", "time": "2015-10-20T10:20:30Z",
"tree": null, "tree": null,
@ -955,14 +955,7 @@
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
"paths": [ "paths": null
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
}, },
"matches": [ "matches": [
"last snapshot" "last snapshot"
@ -992,7 +985,11 @@
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
"paths": null "paths": null,
"tags": [
"foo",
"bar"
]
}, },
"matches": [ "matches": [
"last snapshot" "last snapshot"
@ -1005,7 +1002,10 @@
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
"paths": null, "paths": [
"path1",
"path2"
],
"tags": [ "tags": [
"foo", "foo",
"bar" "bar"

View File

@ -150,27 +150,6 @@
"tree": null, "tree": null,
"paths": null "paths": null
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
@ -185,6 +164,27 @@
"bar" "bar"
] ]
}, },
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": null,
"tags": [
"foo",
"bar"
]
},
{
"time": "2015-10-22T10:20:30Z",
"tree": null,
"paths": [
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
},
{ {
"time": "2015-10-20T10:20:30Z", "time": "2015-10-20T10:20:30Z",
"tree": null, "tree": null,
@ -975,14 +975,7 @@
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
"paths": [ "paths": null
"path1",
"path2"
],
"tags": [
"foo",
"bar"
]
}, },
"matches": [ "matches": [
"last snapshot" "last snapshot"
@ -1012,7 +1005,11 @@
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
"paths": null "paths": null,
"tags": [
"foo",
"bar"
]
}, },
"matches": [ "matches": [
"last snapshot" "last snapshot"
@ -1025,7 +1022,10 @@
"snapshot": { "snapshot": {
"time": "2015-10-22T10:20:30Z", "time": "2015-10-22T10:20:30Z",
"tree": null, "tree": null,
"paths": null, "paths": [
"path1",
"path2"
],
"tags": [ "tags": [
"foo", "foo",
"bar" "bar"