Skip to content

Commit 5be3bea

Browse files
committed
Bump golang and golangci-lint
1 parent 375e709 commit 5be3bea

10 files changed

Lines changed: 97 additions & 64 deletions

File tree

.github/workflows/golangci-lint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v2.5.1
17+
uses: golangci/golangci-lint-action@v2.5.2
1818
with:
1919
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
20-
version: v1.39.0
20+
version: v1.42.0
2121

2222
# Optional: working directory, useful for monorepos
2323
# working-directory: somedir

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ on:
88

99
env:
1010
GO111MODULE: "on"
11-
GO_LATEST_VERSION: "1.16.x"
11+
GO_LATEST_VERSION: "1.17.x"
1212

1313
jobs:
1414
test:
1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
os: [ ubuntu-latest, macos-latest ]
19-
go-version: [ 1.15.x, 1.16.x ]
19+
go-version: [ 1.16.x, 1.17.x ]
2020
runs-on: ${{ matrix.os }}
2121
steps:
2222
- name: Install Go

.golangci.yaml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,30 @@ linters-settings:
2020
linters:
2121
enable-all: true
2222
disable:
23-
- lll
24-
- maligned
25-
- gochecknoglobals
26-
- gomnd
27-
- wrapcheck
28-
- paralleltest
29-
- forbidigo
3023
- exhaustivestruct
31-
- interfacer
24+
- forbidigo
3225
- forcetypeassert
26+
- gci
27+
- gochecknoglobals
28+
- golint
29+
- gomnd
3330
- ifshort
31+
- interfacer
32+
- lll
33+
- maligned
34+
- paralleltest
35+
- scopelint
3436
- testpackage
35-
- gci
37+
- wrapcheck
3638

3739
issues:
3840
exclude-use-default: false
3941
exclude-rules:
4042
- linters:
41-
- gomnd
43+
- dupl
44+
- funlen
4245
- goconst
4346
- goerr113
47+
- gomnd
4448
- noctx
45-
- funlen
46-
- dupl
4749
path: "_test.go"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ An installer for [plugin-registry](https://github.com/nhatthm/plugin-registry)
1111

1212
## Prerequisites
1313

14-
- `Go >= 1.15`
14+
- `Go >= 1.16`
1515

1616
## Install
1717

@@ -29,7 +29,7 @@ The installer supports this source format: `[https?://][www.]github.com/owner/re
2929
- `github.com/owner/repository@latest`
3030
- `github.com/owner/repository@v1.4.2`
3131

32-
In the root folder of the repository, there must be a `.plugin.registry.yaml` file that describe the plugin.
32+
In the root folder of the repository, there must be a `.plugin.registry.yaml` file that describe the plugin.
3333
For example: https://github.com/nhatthm/moneylovercli-plugin-n26/blob/master/.plugin.registry.yaml
3434

3535
## Examples

go.mod

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
11
module github.com/nhatthm/plugin-registry-github
22

3-
go 1.16
3+
go 1.17
44

55
require (
6-
github.com/bool64/ctxd v0.1.4
7-
github.com/google/go-github/v35 v35.1.0
6+
github.com/bool64/ctxd v1.0.0
7+
github.com/google/go-github/v35 v35.3.0
88
github.com/nhatthm/aferoassert v0.1.5
99
github.com/nhatthm/aferomock v0.3.0
1010
github.com/nhatthm/httpmock v0.6.3
11-
github.com/nhatthm/plugin-registry v0.1.2
12-
github.com/nhatthm/plugin-registry-fs v0.1.0
11+
github.com/nhatthm/plugin-registry v0.2.0
12+
github.com/nhatthm/plugin-registry-fs v0.2.0
1313
github.com/spf13/afero v1.6.0
1414
github.com/stretchr/testify v1.7.0
1515
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
1616
)
17+
18+
require (
19+
github.com/bool64/shared v0.1.3 // indirect
20+
github.com/davecgh/go-spew v1.1.1 // indirect
21+
github.com/fatih/structtag v1.2.0 // indirect
22+
github.com/google/go-querystring v1.1.0 // indirect
23+
github.com/iancoleman/orderedmap v0.2.0 // indirect
24+
github.com/nhatthm/aferocopy v1.0.2 // indirect
25+
github.com/pmezard/go-difflib v1.0.0 // indirect
26+
github.com/sergi/go-diff v1.2.0 // indirect
27+
github.com/stretchr/objx v0.3.0 // indirect
28+
github.com/swaggest/assertjson v1.6.4 // indirect
29+
github.com/yudai/gojsondiff v1.0.0 // indirect
30+
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
31+
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
32+
golang.org/x/text v0.3.6 // indirect
33+
)

go.sum

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
github.com/bool64/ctxd v0.1.4 h1:UxL3FCpnLP/h6cZFKBGxAL9TXMd45l8QZQdG35D7BlU=
2-
github.com/bool64/ctxd v0.1.4/go.mod h1:vbCBsEfD4TGXGTPEEQwjB4M5Ny2MC8r+9N2JSP3yJPY=
1+
github.com/bool64/ctxd v1.0.0 h1:Btvo6BU5FulG7H2V9m5Il/2vcqT0nxe86AiEpbG08/I=
2+
github.com/bool64/ctxd v1.0.0/go.mod h1:+rjDVFNOJeO+xlvMqQfG0p53CzuRB7FhPSo5nWSkpQ0=
33
github.com/bool64/dev v0.1.25/go.mod h1:cTHiTDNc8EewrQPy3p1obNilpMpdmlUesDkFTF2zRWU=
4-
github.com/bool64/dev v0.1.26 h1:9RppeANjTKsF0ZEROkgh0z8qKTvpNeVmKnz0uuCAkS4=
5-
github.com/bool64/dev v0.1.26/go.mod h1:cTHiTDNc8EewrQPy3p1obNilpMpdmlUesDkFTF2zRWU=
4+
github.com/bool64/dev v0.1.28 h1:bL7WI4kF5RzjzsQ+8wyWtqQkasw4m4q8l1Cz3CjShZE=
5+
github.com/bool64/dev v0.1.28/go.mod h1:cTHiTDNc8EewrQPy3p1obNilpMpdmlUesDkFTF2zRWU=
66
github.com/bool64/shared v0.1.3 h1:gj7XZPYa1flQsCg3q9AIju+W2A1jaexK0fdFu2XtaG0=
77
github.com/bool64/shared v0.1.3/go.mod h1:RF1p1Oi29ofgOvinBpetbF5mceOUP3kpMkvLbWOmtm0=
88
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -25,10 +25,15 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
2525
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
2626
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
2727
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
28-
github.com/google/go-github/v35 v35.1.0 h1:KkwZnKWQ/0YryvXjZlCN/3EGRJNp6VCZPKo+RG9mG28=
29-
github.com/google/go-github/v35 v35.1.0/go.mod h1:s0515YVTI+IMrDoy9Y4pHt9ShGpzHvHO8rZ7L7acgvs=
28+
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
29+
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
30+
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
31+
github.com/google/go-github/v35 v35.3.0 h1:fU+WBzuukn0VssbayTT+Zo3/ESKX9JYWjbZTLOTEyho=
32+
github.com/google/go-github/v35 v35.3.0/go.mod h1:yWB7uCcVWaUbUP74Aq3whuMySRMatyRmq5U9FTNlbio=
3033
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
3134
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
35+
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
36+
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
3237
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
3338
github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA=
3439
github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
@@ -45,18 +50,16 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX
4550
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
4651
github.com/nhatthm/aferoassert v0.1.5 h1:5BKwmRUpthkJpEPUPtcMHN37mdpFbYCECCJWhI/opRU=
4752
github.com/nhatthm/aferoassert v0.1.5/go.mod h1:l5NAuwTqiLY2vXnNbi61wE9YkEu3L9SaTNmcRyMzn2Y=
48-
github.com/nhatthm/aferocopy v1.0.0/go.mod h1:uSMufOvC0XRCuUMkR1UNe4rK+Fb1DOA/rqXG/qnbE7M=
49-
github.com/nhatthm/aferocopy v1.0.1 h1:DLRi9ZTWZFsTEo8rFMqDDO4sCn3JeA7ZggGAfh8KABU=
50-
github.com/nhatthm/aferocopy v1.0.1/go.mod h1:uSMufOvC0XRCuUMkR1UNe4rK+Fb1DOA/rqXG/qnbE7M=
53+
github.com/nhatthm/aferocopy v1.0.2 h1:HGWGrmsZESpEECm9uZhu+jeReB+ple6/8ABfWR1aAyk=
54+
github.com/nhatthm/aferocopy v1.0.2/go.mod h1:KL35sFRDPSvdxcsCarAwaja69rsSnk7KYbf7SljBOGw=
5155
github.com/nhatthm/aferomock v0.3.0 h1:VaQORa7jawxeTi7yAAayE8ZUo7lYp5yyDn9j3wwKJNA=
5256
github.com/nhatthm/aferomock v0.3.0/go.mod h1:/oTcy0NDM+qQJEEOWiuiKuogilXvv/KZcdaXaP/rX3g=
5357
github.com/nhatthm/httpmock v0.6.3 h1:vt2vw2EUsPpyOMfCVrfZ+Rt9ZZVV+yBQiFn0Vd5ECoA=
5458
github.com/nhatthm/httpmock v0.6.3/go.mod h1:wE9KU1RZGYD0eLqy5bHieJkG4lU0kWauNyrqzj9Lx+U=
55-
github.com/nhatthm/plugin-registry v0.1.1/go.mod h1:ImZoJ9CVf40EDM7oFcNABAYCCFExHH6mrJViesJBUSg=
56-
github.com/nhatthm/plugin-registry v0.1.2 h1:VSW44zHjW3Q7sGpj4M3uqRRUSioDUgrxQMCQ56M7p4o=
57-
github.com/nhatthm/plugin-registry v0.1.2/go.mod h1:80Aph6uPZnJhWdUOFFX8ZkF5qNSf8TIVaKdMtxQ0j1c=
58-
github.com/nhatthm/plugin-registry-fs v0.1.0 h1:JcgbKgYc6yuyp0DWhJiNpi1661ns9fvY26rWzmlxUmY=
59-
github.com/nhatthm/plugin-registry-fs v0.1.0/go.mod h1:YmE3LmakOKnFqKGGLzVnc2KUgY7YThDOA6FdjYDxd1E=
59+
github.com/nhatthm/plugin-registry v0.2.0 h1:l2RQxgkO1coZuEyi/eQnFhhdFw4TAIACm4c73EnEgeI=
60+
github.com/nhatthm/plugin-registry v0.2.0/go.mod h1:Hg0uwripGDvh1PCIuHemuej/IAm8Eggtfc/Egiue3QI=
61+
github.com/nhatthm/plugin-registry-fs v0.2.0 h1:FNjmRSXT6k0tQ7ePv+TXVHVHd039lLpSM3QxR1REuKY=
62+
github.com/nhatthm/plugin-registry-fs v0.2.0/go.mod h1:bTrp2zfjWgShoYWWJT2e147i7kgwLL3z6tkt7pVEGfM=
6063
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
6164
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
6265
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=

installer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func (i *Installer) installPluginReleaseAsset(
154154
return nil, ctxd.WrapError(ctx, err, "could not write artifact")
155155
}
156156

157-
if err := chmod(i.fs, asset.ContentType, assetFile, 0755); err != nil {
157+
if err := chmod(i.fs, asset.ContentType, assetFile, 0o755); err != nil {
158158
return nil, ctxd.WrapError(ctx, err, "could not chmod artifact")
159159
}
160160

installer_ingration_test.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ import (
1212
goGitHub "github.com/google/go-github/v35/github"
1313
"github.com/nhatthm/aferoassert"
1414
"github.com/nhatthm/httpmock"
15-
github "github.com/nhatthm/plugin-registry-github"
1615
fsCtx "github.com/nhatthm/plugin-registry/context"
1716
"github.com/nhatthm/plugin-registry/installer"
1817
"github.com/nhatthm/plugin-registry/plugin"
1918
"github.com/spf13/afero"
2019
"github.com/stretchr/testify/assert"
2120
"github.com/stretchr/testify/require"
2221
"gopkg.in/yaml.v3"
22+
23+
github "github.com/nhatthm/plugin-registry-github"
2324
)
2425

2526
func newRepositoryService(baseURL string) github.RepositoryService {
@@ -105,6 +106,7 @@ func TestIntegrationInstaller_Install(t *testing.T) {
105106
Version: "1.4.2",
106107
Enabled: false,
107108
Hidden: true,
109+
Tags: plugin.Tags{},
108110
Artifacts: plugin.Artifacts{
109111
plugin.RuntimeArtifactIdentifier(): {
110112
File: "my-plugin.zip",
@@ -121,6 +123,7 @@ func TestIntegrationInstaller_Install(t *testing.T) {
121123
Version: "1.4.2",
122124
Enabled: false,
123125
Hidden: true,
126+
Tags: plugin.Tags{},
124127
Artifacts: plugin.Artifacts{
125128
plugin.RuntimeArtifactIdentifier(): {
126129
File: "my-plugin-no-parent.zip",
@@ -137,6 +140,7 @@ func TestIntegrationInstaller_Install(t *testing.T) {
137140
Version: "1.4.2",
138141
Enabled: false,
139142
Hidden: true,
143+
Tags: plugin.Tags{},
140144
Artifacts: plugin.Artifacts{
141145
plugin.RuntimeArtifactIdentifier(): {
142146
File: "my-plugin.tar.gz",
@@ -153,6 +157,7 @@ func TestIntegrationInstaller_Install(t *testing.T) {
153157
Version: "1.4.2",
154158
Enabled: false,
155159
Hidden: true,
160+
Tags: plugin.Tags{},
156161
Artifacts: plugin.Artifacts{
157162
plugin.RuntimeArtifactIdentifier(): {
158163
File: "my-plugin-no-parent.gz",
@@ -169,6 +174,7 @@ func TestIntegrationInstaller_Install(t *testing.T) {
169174
Version: "1.4.2",
170175
Enabled: false,
171176
Hidden: true,
177+
Tags: plugin.Tags{},
172178
Artifacts: plugin.Artifacts{
173179
plugin.RuntimeArtifactIdentifier(): {
174180
File: "my-plugin",
@@ -186,6 +192,7 @@ func TestIntegrationInstaller_Install(t *testing.T) {
186192
Version: "1.4.2",
187193
Enabled: false,
188194
Hidden: true,
195+
Tags: plugin.Tags{},
189196
Artifacts: plugin.Artifacts{
190197
plugin.RuntimeArtifactIdentifier(): {
191198
File: "my-plugin",
@@ -203,6 +210,7 @@ func TestIntegrationInstaller_Install(t *testing.T) {
203210
Version: "1.4.2",
204211
Enabled: false,
205212
Hidden: true,
213+
Tags: plugin.Tags{},
206214
Artifacts: plugin.Artifacts{
207215
plugin.RuntimeArtifactIdentifier(): {
208216
File: "my-plugin",
@@ -220,6 +228,7 @@ func TestIntegrationInstaller_Install(t *testing.T) {
220228
Version: "1.4.2",
221229
Enabled: false,
222230
Hidden: true,
231+
Tags: plugin.Tags{},
223232
Artifacts: plugin.Artifacts{
224233
plugin.RuntimeArtifactIdentifier(): {
225234
File: "my-plugin",
@@ -255,7 +264,7 @@ func TestIntegrationInstaller_Install(t *testing.T) {
255264

256265
file := filepath.Join(dest, result.Name, result.Name)
257266

258-
aferoassert.Perm(t, osFs, file, 0755)
267+
aferoassert.Perm(t, osFs, file, 0o755)
259268
aferoassert.FileContent(t, osFs, file, "#!/bin/bash\n")
260269
})
261270
}
@@ -286,6 +295,7 @@ func TestWithBaseURL(t *testing.T) {
286295
Version: "1.4.2",
287296
Enabled: false,
288297
Hidden: true,
298+
Tags: plugin.Tags{},
289299
Artifacts: plugin.Artifacts{
290300
plugin.RuntimeArtifactIdentifier(): {
291301
File: "my-plugin",
@@ -297,6 +307,6 @@ func TestWithBaseURL(t *testing.T) {
297307

298308
file := filepath.Join(dest, result.Name, result.Name)
299309

300-
aferoassert.Perm(t, osFs, file, 0755)
310+
aferoassert.Perm(t, osFs, file, 0o755)
301311
aferoassert.FileContent(t, osFs, file, "#!/bin/bash\n")
302312
}

0 commit comments

Comments
 (0)