Skip to content

Commit

Permalink
Bump golang.org/x/crypto from 0.0.0-20220214200702-86341886e292 to 0.…
Browse files Browse the repository at this point in the history
…17.0 (#64)

* Bump golang.org/x/crypto

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20220214200702-86341886e292 to 0.17.0.
- [Commits](https://github.com/golang/crypto/commits/v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* use last go, golang-ci & alpine version

to avoid this error during lint:
```
 # golang.org/x/tools/go/ast/astutil
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/go/ast/astutil/enclosing.go:323:23: n.Type.TypeParams undefined (type *ast.FuncType has no field or method TypeParams)
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/go/ast/astutil/enclosing.go:378:8: undefined: ast.IndexListExpr
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/go/ast/astutil/enclosing.go:589:8: undefined: ast.IndexListExpr
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/go/ast/astutil/rewrite.go:253:8: undefined: ast.IndexListExpr
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/go/ast/astutil/rewrite.go:294:18: n.TypeParams undefined (type *ast.FuncType has no field or method TypeParams)
Error: ../../../go/pkg/mod/golang.org/x/[email protected]/go/ast/astutil/rewrite.go:409:18: n.TypeParams undefined (type *ast.TypeSpec has no field or method TypeParams)
note: module requires Go 1.19
```

remove deprecated flag `-i` with `go build`:
```
flag provided but not defined: -i
```

* replace io/ioutil usages

to make golangci-lint happy

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Bourdier <[email protected]>
  • Loading branch information
dependabot[bot] and PascalBourdier authored Jul 16, 2024
1 parent e2627ae commit 64af0ed
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 329 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.17
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: '1.22'
id: go

- name: Check out code into the Go module directory
Expand All @@ -26,17 +26,16 @@ jobs:
run: make fmtcheck

- name: Linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.46
uses: golangci/golangci-lint-action@v6

build:
name: test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.17
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: '1.22'
id: go

- name: Check out code into the Go module directory
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: '1.22'
id: go

- name: Build
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine as app-builder
FROM golang:1.22-alpine as app-builder

ENV SRC_DIR /s3proxy
WORKDIR $SRC_DIR
Expand All @@ -14,15 +14,15 @@ COPY . ./
RUN apk add build-base curl && make


FROM golang:1.17-alpine as lib-builder
FROM golang:1.22-alpine as lib-builder

WORKDIR /root
RUN apk add git
RUN git clone https://github.com/mirakl/dns-aaaa-no-more.git
RUN apk add build-base && cd dns-aaaa-no-more && make


FROM alpine:3.15
FROM alpine:3.20

# Magic !
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ GOFILES = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
default: build

build: clean
go build -i -v ${LDFLAGS} -o ${NAME}
go build -v ${LDFLAGS} -o ${NAME}

clean:
if [ -f "${NAME}" ] ; then rm ${NAME} ; fi

lint:
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.46.2 golangci-lint run -v
docker run --rm -v $(PWD):/app -w /app golangci/golangci-lint:v1.59.1 golangci-lint run -v

fmtcheck: tools.goimports
@echo "--> checking code formatting with 'goimports' tool"
Expand Down
1 change: 1 addition & 0 deletions backend/backendtest/s3fakebackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (b *S3FakeBackend) DeleteObject(object backend.BucketObject) error {
}

func (b *S3FakeBackend) BatchDeleteObjects(objects []backend.BucketObject) error {
_ = objects
return nil
}

Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/mirakl/s3proxy

go 1.17
go 1.22

require (
github.com/aws/aws-sdk-go v1.42.53
Expand Down Expand Up @@ -37,9 +37,9 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/ugorji/go/codec v1.2.6 // indirect
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/text v0.3.8 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/ini.v1 v1.66.4 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
315 changes: 8 additions & 307 deletions go.sum

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions s3proxytest/s3proxytest.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
jsonlib "encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httptest"
"net/url"
Expand All @@ -26,7 +25,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/go-errors/errors"
"github.com/mirakl/s3proxy/backend"
logging "github.com/op/go-logging"
"github.com/op/go-logging"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -231,7 +230,7 @@ func verifyFileCheckSumEquality(t *testing.T, file1 *os.File, file2 *os.File) bo
// if size = 0 => empty file otherwise a file with random characters
func createTempFileInMB(t *testing.T, size int) (*os.File, int64) {

file, err := ioutil.TempFile(os.TempDir(), "s3proxy")
file, err := os.CreateTemp(os.TempDir(), "s3proxy")
assert.Nil(t, err)

if size > 0 {
Expand Down Expand Up @@ -308,7 +307,7 @@ func httpCall(t *testing.T, httpMethod string, url string, contentType string, a
}

if body != nil {
req.Body = ioutil.NopCloser(body)
req.Body = io.NopCloser(body)
req.ContentLength = bodySize
}

Expand All @@ -327,7 +326,7 @@ func httpCall(t *testing.T, httpMethod string, url string, contentType string, a

statusCode = response.StatusCode

bytes, err = ioutil.ReadAll(response.Body)
bytes, err = io.ReadAll(response.Body)
assert.Nil(t, err)
}

Expand Down

0 comments on commit 64af0ed

Please sign in to comment.