Skip to content

Commit 5fcc96e

Browse files
authored
Cleanup: Lint warnings and deprecated packages (#263)
* Fix lint warnings and std lib deprecations * Replace deprecated std lib with maintained drop-in replacement fork Backwartds compatible with original package and suggested by std lib due to security and stability issues. * OAuth2 is now a direct dependency due to Dropbox * Undo change * Revert "Replace deprecated std lib with maintained drop-in replacement fork" This reverts commit 2887bd4. * Update channel handling * Add linter for PRs * Rename CI, fetch all issues, add govet
1 parent 3d7677f commit 5fcc96e

File tree

10 files changed

+97
-20
lines changed

10 files changed

+97
-20
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Run Linters
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
11+
pull-requests: read
12+
13+
jobs:
14+
golangci:
15+
name: lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-go@v4
20+
with:
21+
go-version: '1.21'
22+
cache: false
23+
- name: golangci-lint
24+
uses: golangci/golangci-lint-action@v3
25+
with:
26+
# Require: The version of golangci-lint to use.
27+
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
28+
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
29+
version: v1.54
30+
31+
# Optional: working directory, useful for monorepos
32+
# working-directory: somedir
33+
34+
# Optional: golangci-lint command line arguments.
35+
#
36+
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
37+
# The location of the configuration file can be changed by using `--config=`
38+
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0
39+
40+
# Optional: show only new issues if it's a pull request. The default value is `false`.
41+
# only-new-issues: true
42+
43+
# Optional: if set to true, then all caching functionality will be completely disabled,
44+
# takes precedence over all other caching options.
45+
# skip-cache: true
46+
47+
# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
48+
# skip-pkg-cache: true
49+
50+
# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
51+
# skip-build-cache: true
52+
53+
# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
54+
# install-mode: "goinstall"

.golangci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
linters:
2+
# Enable specific linter
3+
# https://golangci-lint.run/usage/linters/#enabled-by-default
4+
enable:
5+
- staticcheck
6+
- govet
7+
output:
8+
format: github-actions

cmd/backup/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"crypto/x509"
88
"encoding/pem"
99
"fmt"
10-
"io/ioutil"
1110
"os"
1211
"regexp"
1312
"strconv"
@@ -115,7 +114,7 @@ func (c *CertDecoder) Decode(v string) error {
115114
if v == "" {
116115
return nil
117116
}
118-
content, err := ioutil.ReadFile(v)
117+
content, err := os.ReadFile(v)
119118
if err != nil {
120119
content = []byte(v)
121120
}

cmd/backup/exec.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"bytes"
1111
"context"
1212
"fmt"
13-
"io/ioutil"
13+
"io"
1414
"os"
1515
"strings"
1616

@@ -51,19 +51,15 @@ func (s *script) exec(containerRef string, command string, user string) ([]byte,
5151
outputDone <- err
5252
}()
5353

54-
select {
55-
case err := <-outputDone:
56-
if err != nil {
57-
return nil, nil, fmt.Errorf("exec: error demultiplexing output: %w", err)
58-
}
59-
break
54+
if <-outputDone != nil {
55+
return nil, nil, fmt.Errorf("exec: error demultiplexing output: %w", err)
6056
}
6157

62-
stdout, err := ioutil.ReadAll(&outBuf)
58+
stdout, err := io.ReadAll(&outBuf)
6359
if err != nil {
6460
return nil, nil, fmt.Errorf("exec: error reading stdout: %w", err)
6561
}
66-
stderr, err := ioutil.ReadAll(&errBuf)
62+
stderr, err := io.ReadAll(&errBuf)
6763
if err != nil {
6864
return nil, nil, fmt.Errorf("exec: error reading stderr: %w", err)
6965
}
@@ -152,9 +148,9 @@ func (s *script) runLabeledCommands(label string) error {
152148
g.Go(func() error {
153149
cmd, ok := c.Labels[label]
154150
if !ok && label == "docker-volume-backup.archive-pre" {
155-
cmd, _ = c.Labels["docker-volume-backup.exec-pre"]
151+
cmd = c.Labels["docker-volume-backup.exec-pre"]
156152
} else if !ok && label == "docker-volume-backup.archive-post" {
157-
cmd, _ = c.Labels["docker-volume-backup.exec-post"]
153+
cmd = c.Labels["docker-volume-backup.exec-post"]
158154
}
159155

160156
userLabelName := fmt.Sprintf("%s.user", label)

cmd/backup/lock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
func (s *script) lock(lockfile string) (func() error, error) {
1919
start := time.Now()
2020
defer func() {
21-
s.stats.LockedTime = time.Now().Sub(start)
21+
s.stats.LockedTime = time.Since(start)
2222
}()
2323

2424
retry := time.NewTicker(5 * time.Second)

cmd/backup/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func main() {
1515
}
1616

1717
unlock, err := s.lock("/var/lock/dockervolumebackup.lock")
18-
defer unlock()
18+
defer s.must(unlock())
1919
s.must(err)
2020

2121
defer func() {
@@ -34,7 +34,6 @@ func main() {
3434
if err := s.runHooks(nil); err != nil {
3535
s.logger.Error(
3636
fmt.Sprintf(
37-
3837
"Backup procedure ran successfully, but an error ocurred calling the registered hooks: %v",
3938
err,
4039
),

cmd/backup/script.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/offen/docker-volume-backup/internal/storage/ssh"
2626
"github.com/offen/docker-volume-backup/internal/storage/webdav"
2727

28+
"github.com/ProtonMail/go-crypto/openpgp"
2829
"github.com/containrrr/shoutrrr"
2930
"github.com/containrrr/shoutrrr/pkg/router"
3031
"github.com/docker/docker/api/types"
@@ -35,7 +36,6 @@ import (
3536
"github.com/kelseyhightower/envconfig"
3637
"github.com/leekchan/timeutil"
3738
"github.com/otiai10/copy"
38-
"golang.org/x/crypto/openpgp"
3939
"golang.org/x/sync/errgroup"
4040
)
4141

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ require (
1717
github.com/pkg/sftp v1.13.6
1818
github.com/studio-b12/gowebdav v0.9.0
1919
golang.org/x/crypto v0.12.0
20+
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783
2021
golang.org/x/sync v0.3.0
2122
)
2223

2324
require (
25+
github.com/cloudflare/circl v1.3.3 // indirect
2426
github.com/golang/protobuf v1.5.2 // indirect
25-
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
2627
google.golang.org/appengine v1.6.7 // indirect
2728
google.golang.org/protobuf v1.28.1 // indirect
2829
)
@@ -32,6 +33,7 @@ require (
3233
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
3334
github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 // indirect
3435
github.com/Microsoft/go-winio v0.5.2 // indirect
36+
github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95
3537
github.com/docker/distribution v2.8.2+incompatible // indirect
3638
github.com/docker/go-connections v0.4.0 // indirect
3739
github.com/docker/go-units v0.4.0 // indirect

go.sum

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3
201201
github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA=
202202
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
203203
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
204+
github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 h1:KLq8BE0KwCL+mmXnjLWEAOYO+2l2AE4YMmqG1ZpZHBs=
205+
github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
204206
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
205207
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
206208
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
@@ -218,6 +220,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
218220
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
219221
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
220222
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
223+
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
221224
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
222225
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
223226
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
@@ -227,6 +230,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
227230
github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag=
228231
github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I=
229232
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
233+
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
234+
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
230235
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
231236
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
232237
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
@@ -664,6 +669,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
664669
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
665670
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
666671
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
672+
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
673+
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
667674
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
668675
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
669676
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -704,6 +711,7 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
704711
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
705712
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
706713
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
714+
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
707715
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
708716
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
709717
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -762,6 +770,9 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
762770
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
763771
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
764772
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
773+
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
774+
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
775+
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
765776
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
766777
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
767778
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -901,12 +912,18 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc
901912
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
902913
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
903914
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
915+
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
916+
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
904917
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
918+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
905919
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
906920
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
907921
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
908922
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
909923
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
924+
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
925+
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
926+
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
910927
golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
911928
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
912929
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -919,6 +936,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
919936
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
920937
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
921938
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
939+
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
940+
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
922941
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
923942
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
924943
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -986,6 +1005,7 @@ golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
9861005
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
9871006
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
9881007
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
1008+
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
9891009
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
9901010
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
9911011
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

internal/storage/ssh/ssh.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"errors"
88
"fmt"
99
"io"
10-
"io/ioutil"
1110
"os"
1211
"path"
1312
"path/filepath"
@@ -46,7 +45,7 @@ func NewStorageBackend(opts Config, logFunc storage.Log) (storage.Backend, error
4645
}
4746

4847
if _, err := os.Stat(opts.IdentityFile); err == nil {
49-
key, err := ioutil.ReadFile(opts.IdentityFile)
48+
key, err := os.ReadFile(opts.IdentityFile)
5049
if err != nil {
5150
return nil, errors.New("NewStorageBackend: error reading the private key")
5251
}

0 commit comments

Comments
 (0)