Skip to content
Snippets Groups Projects
Commit 72b5987f authored by Lyuben Penkovski's avatar Lyuben Penkovski
Browse files

Update to Go 1.19.3 and fix linters warnings and errors

parent 2d22f6a2
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ include: ...@@ -16,7 +16,7 @@ include:
- template: 'Workflows/Branch-Pipelines.gitlab-ci.yml' - template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
lint: lint:
image: golangci/golangci-lint:v1.44.2 image: golangci/golangci-lint:v1.50.1
stage: test stage: test
tags: tags:
- amd64-docker - amd64-docker
...@@ -28,12 +28,27 @@ lint: ...@@ -28,12 +28,27 @@ lint:
- cd /go/src/gitlab.com/${CI_PROJECT_PATH} - cd /go/src/gitlab.com/${CI_PROJECT_PATH}
unit tests: unit tests:
image: golang:1.17.7 image: golang:1.19.3
extends: .gotest extends: .gotest
stage: test stage: test
tags: tags:
- amd64-docker - amd64-docker
before_script: [] before_script: []
coverage: '/total:\s+\(statements\)\s+(\d+.\d+\%)/'
govulncheck:
image: golang:1.19.3
stage: test
tags:
- amd64-docker
before_script:
- ln -s /builds /go/src/gitlab.com
- cd /go/src/gitlab.com/${CI_PROJECT_PATH}
script:
- go version
- go install golang.org/x/vuln/cmd/govulncheck@latest
- govulncheck ./...
amd64: amd64:
extends: .docker-build extends: .docker-build
......
...@@ -12,7 +12,6 @@ linters: ...@@ -12,7 +12,6 @@ linters:
enable: enable:
- megacheck - megacheck
- govet - govet
- deadcode
- errcheck - errcheck
- goconst - goconst
- gocyclo - gocyclo
...@@ -22,10 +21,9 @@ linters: ...@@ -22,10 +21,9 @@ linters:
- ineffassign - ineffassign
- nakedret - nakedret
- staticcheck - staticcheck
- structcheck
- unconvert - unconvert
- varcheck
- vet - vet
- vetshadow - vetshadow
- misspell - misspell
- staticcheck - staticcheck
- unused
...@@ -239,7 +239,7 @@ func exposeMetrics(addr string, logger *zap.Logger) { ...@@ -239,7 +239,7 @@ func exposeMetrics(addr string, logger *zap.Logger) {
promMux := http.NewServeMux() promMux := http.NewServeMux()
promMux.Handle("/metrics", promhttp.Handler()) promMux.Handle("/metrics", promhttp.Handler())
logger.Info(fmt.Sprintf("exposing prometheus metrics at %s/metrics", addr)) logger.Info(fmt.Sprintf("exposing prometheus metrics at %s/metrics", addr))
if err := http.ListenAndServe(addr, promMux); err != nil { if err := http.ListenAndServe(addr, promMux); err != nil { //nolint:gosec
logger.Error("error exposing prometheus metrics", zap.Error(err)) logger.Error("error exposing prometheus metrics", zap.Error(err))
} }
} }
FROM golang:1.19-alpine3.15 as builder FROM golang:1.19.3-alpine3.15 as builder
RUN apk add git RUN apk add git
......
FROM golang:1.19 FROM golang:1.19.3
ENV GO111MODULE=on ENV GO111MODULE=on
......
...@@ -6,7 +6,6 @@ import ( ...@@ -6,7 +6,6 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"net/http" "net/http"
"github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable"
...@@ -105,7 +104,7 @@ func (c *Client) VerifyPresentation(ctx context.Context, vp []byte) error { ...@@ -105,7 +104,7 @@ func (c *Client) VerifyPresentation(ctx context.Context, vp []byte) error {
} }
func getErrorBody(resp *http.Response) string { func getErrorBody(resp *http.Response) string {
body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 2<<20)) body, err := io.ReadAll(io.LimitReader(resp.Body, 2<<20))
if err != nil { if err != nil {
return "" return ""
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment