Skip to content

Commit

Permalink
chore(ci): upgraded linter to 1.47.0, added 15s ReadHeaderTimeout in …
Browse files Browse the repository at this point in the history
…web server
  • Loading branch information
jkowalski committed Jul 19, 2022
1 parent 78220d0 commit 082d6a6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ linters:
- exhaustruct
- gochecknoinits
- golint
- gci
- ifshort
- interfacer
- ireturn # this one may be interesting to control allocations
- maligned
- nilnil
- nlreturn
- nonamedreturns
- nosnakecase
- paralleltest
- prealloc
- scopelint
Expand Down
3 changes: 2 additions & 1 deletion cli/command_server_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ func (c *commandServerStart) run(ctx context.Context) error {
}

httpServer := &http.Server{
Addr: stripProtocol(c.sf.serverAddress),
ReadHeaderTimeout: 15 * time.Second, // nolint:gomnd
Addr: stripProtocol(c.sf.serverAddress),
BaseContext: func(l net.Listener) context.Context {
return ctx
},
Expand Down
4 changes: 3 additions & 1 deletion internal/mount/mount_webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net"
"net/http"
"os"
"time"

"github.com/pkg/errors"
"golang.org/x/net/webdav"
Expand Down Expand Up @@ -51,7 +52,8 @@ func DirectoryWebDAV(ctx context.Context, entry fs.Directory) (Controller, error
}

srv := &http.Server{
Handler: mux,
ReadHeaderTimeout: 15 * time.Second, // nolint:gomnd
Handler: mux,
}

done := make(chan struct{})
Expand Down
5 changes: 1 addition & 4 deletions tests/tools/kopiarunner/kopiarun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ func TestKopiaRunner(t *testing.T) {
},
} {
t.Run(tt.name, func(t *testing.T) {
err := os.Setenv("KOPIA_EXE", tt.exe)
if err != nil {
t.Fatal("Unable to set environment variable KOPIA_EXE")
}
t.Setenv("KOPIA_EXE", tt.exe)

runner, err := NewRunner("")
if (err != nil) != tt.expNewRunnerErr {
Expand Down
12 changes: 6 additions & 6 deletions tools/gettool/checksums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ https://github.com/gohugoio/hugo/releases/download/v0.89.2/hugo_extended_0.89.2_
https://github.com/gohugoio/hugo/releases/download/v0.89.2/hugo_extended_0.89.2_macOS-64bit.tar.gz: f9185f6d14eb84d9029d59cdd8a977f2f0be334c4f9d38f2099e56a0c0734731
https://github.com/gohugoio/hugo/releases/download/v0.89.2/hugo_extended_0.89.2_macOS-ARM64.tar.gz: 99a5b4738528d4858a0237199eabc7aee77674c8c7edcfe269efb4b515566cec
https://github.com/gohugoio/hugo/releases/download/v0.89.2/hugo_extended_0.89.2_windows-64bit.zip: 8d79db4f24fbf023c64862c37d09291ac216875dad91e71dd8753cb5883e4274
https://github.com/golangci/golangci-lint/releases/download/v1.46.2/golangci-lint-1.46.2-darwin-amd64.tar.gz: 658078aaaf7608693f37c4cf1380b2af418ab8b2d23fdb33e7e2d4339328590e
https://github.com/golangci/golangci-lint/releases/download/v1.46.2/golangci-lint-1.46.2-darwin-arm64.tar.gz: 81f9b4afd62ec5e612ef8bc3b1d612a88b56ff289874831845cdad394427385f
https://github.com/golangci/golangci-lint/releases/download/v1.46.2/golangci-lint-1.46.2-linux-amd64.tar.gz: 242cd4f2d6ac0556e315192e8555784d13da5d1874e51304711570769c4f2b9b
https://github.com/golangci/golangci-lint/releases/download/v1.46.2/golangci-lint-1.46.2-linux-arm64.tar.gz: ff5448ada2b3982581984d64b0dec614dba0a3ea4cab2d6a343c77927fc89f7e
https://github.com/golangci/golangci-lint/releases/download/v1.46.2/golangci-lint-1.46.2-linux-armv6.tar.gz: 177f5210ef04aee282bfbc6ec519d36af5fb7d2b2c8d3f4ea5e59fdba71b0a27
https://github.com/golangci/golangci-lint/releases/download/v1.46.2/golangci-lint-1.46.2-windows-amd64.zip: 604acc1378a566abb0eac799362f3a37b7fcb5fa2268aeb2d5d954c829367301
https://github.com/golangci/golangci-lint/releases/download/v1.47.0/golangci-lint-1.47.0-darwin-amd64.tar.gz: 9bf19d01df5d274f137a4df1dc1f70d37d70eea613936436fa41eda93ed05bcb
https://github.com/golangci/golangci-lint/releases/download/v1.47.0/golangci-lint-1.47.0-darwin-arm64.tar.gz: 0eea96192b4e5c771bb9fee0950bc7d88f4c04880e1a7e717a79f7a5eb794ba2
https://github.com/golangci/golangci-lint/releases/download/v1.47.0/golangci-lint-1.47.0-linux-amd64.tar.gz: b8885fdea31b63e6b016898e8ba92283a55d3b744d2474faba44cf053d0ecdef
https://github.com/golangci/golangci-lint/releases/download/v1.47.0/golangci-lint-1.47.0-linux-arm64.tar.gz: 49ba83fccaa4e79ca4207dab065434058b238cf7146a783a58a3f6380354ee8b
https://github.com/golangci/golangci-lint/releases/download/v1.47.0/golangci-lint-1.47.0-linux-armv6.tar.gz: e3e8df724a48f8ec03640abb629f2bb64f66caac133c95083f9644f6aa6631c3
https://github.com/golangci/golangci-lint/releases/download/v1.47.0/golangci-lint-1.47.0-windows-amd64.zip: d9475be660217fb5f8131a12beb564e4bb650f056c15ff0c54757a5ce8877d66
https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Darwin_arm64.tar.gz: 1f95e6561974f4766d8833438b646b06930563ca9867447ea03edb623d876c75
https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Darwin_x86_64.tar.gz: 17ecad881a50e32f033da5a200c8417d37cae70f09e925645452937998aca506
https://github.com/goreleaser/goreleaser/releases/download/v0.176.0/goreleaser_Linux_arm64.tar.gz: 8bf2a9b9e84498bfa239f2fe91b2d555642c87ab9d3f5d37f29e6e97116910a3
Expand Down
2 changes: 1 addition & 1 deletion tools/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ retry:=
endif

# tool versions
GOLANGCI_LINT_VERSION=1.46.2
GOLANGCI_LINT_VERSION=1.47.0
CHECKLOCKS_VERSION=release-20220314.0
NODE_VERSION=16.13.0
HUGO_VERSION=0.89.2
Expand Down

0 comments on commit 082d6a6

Please sign in to comment.