chore(lint): bump from v1.46.2 to v1.49.0

This commit is contained in:
Quentin McGaw
2022-08-28 15:09:50 +00:00
parent 0655f1a080
commit a688255270
5 changed files with 16 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ ARG BUILDPLATFORM=linux/amd64
ARG ALPINE_VERSION=3.16
ARG GO_VERSION=1.17
ARG XCPUTRANSLATE_VERSION=v0.7.0
ARG GOLANGCI_LINT_VERSION=v1.46.2
ARG GOLANGCI_LINT_VERSION=v1.49.0
FROM --platform=${BUILDPLATFORM} qmcgaw/xcputranslate:${XCPUTRANSLATE_VERSION} AS xcputranslate
FROM --platform=${BUILDPLATFORM} qmcgaw/binpot:golangci-lint-${GOLANGCI_LINT_VERSION} AS golangci-lint

View File

@@ -29,7 +29,12 @@ func NewServer(address string, logger logging.Logger, healthcheck func() error)
func (s *server) Run(ctx context.Context, done chan<- struct{}) {
defer close(done)
server := http.Server{Addr: s.address, Handler: s.handler}
server := http.Server{
Addr: s.address,
Handler: s.handler,
ReadHeaderTimeout: time.Second,
ReadTimeout: time.Second,
}
go func() {
<-ctx.Done()
s.logger.Warn("shutting down (context canceled)")

View File

@@ -2,7 +2,6 @@ package params
import (
"io/fs"
"io/ioutil"
"os"
"github.com/qdm12/ddns-updater/internal/settings"
@@ -25,7 +24,7 @@ func NewReader(logger logging.Logger) Reader {
return &reader{
logger: logger,
env: params.New(),
readFile: ioutil.ReadFile,
readFile: os.ReadFile,
writeFile: os.WriteFile,
}
}

View File

@@ -32,7 +32,12 @@ func New(ctx context.Context, address, rootURL string, db data.Database, logger
func (s *server) Run(ctx context.Context, done chan<- struct{}) {
defer close(done)
server := http.Server{Addr: s.address, Handler: s.handler}
server := http.Server{
Addr: s.address,
Handler: s.handler,
ReadHeaderTimeout: time.Second,
ReadTimeout: time.Second,
}
go func() {
<-ctx.Done()
s.logger.Warn("shutting down (context canceled)")

View File

@@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net"
"net/http"
"net/url"
@@ -132,7 +132,7 @@ func (p *provider) Update(ctx context.Context, client *http.Client, ip net.IP) (
}
defer response.Body.Close()
b, err := ioutil.ReadAll(response.Body)
b, err := io.ReadAll(response.Body)
if err != nil {
return nil, fmt.Errorf("%w: %s", errors.ErrUnmarshalResponse, err)
}