Skip to content

Commit

Permalink
update go runtime to 1.21
Browse files Browse the repository at this point in the history
update go runtime to 1.21
  • Loading branch information
madmuffin1 authored Jan 4, 2024
2 parents e2627ae + 843f5e9 commit f2cf597
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
10 changes: 5 additions & 5 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 1.21
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.21
id: go

- name: Check out code into the Go module directory
Expand All @@ -28,15 +28,15 @@ jobs:
- name: Linter
uses: golangci/golangci-lint-action@v3
with:
version: v1.46
version: v1.55
build:
name: test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.17
- name: Set up Go 1.21
uses: actions/setup-go@v2
with:
go-version: 1.17
go-version: 1.21
id: go

- name: Check out code into the Go module directory
Expand Down
4 changes: 2 additions & 2 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.21-alpine as app-builder

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


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

WORKDIR /root
RUN apk add git
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.55.2 golangci-lint run -v

fmtcheck: tools.goimports
@echo "--> checking code formatting with 'goimports' tool"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This presigned URL has a duration period and can be used by any basic HTTP clien
## Requirements

* Docker version 17.12.0+
* Go 1.17+
* Go 1.21+


## Build
Expand Down
2 changes: 1 addition & 1 deletion backend/backendtest/s3fakebackend.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (b *S3FakeBackend) DeleteObject(object backend.BucketObject) error {
return nil
}

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

Expand Down
2 changes: 1 addition & 1 deletion 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.21

require (
github.com/aws/aws-sdk-go v1.42.53
Expand Down
7 changes: 3 additions & 4 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 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 f2cf597

Please sign in to comment.