Skip to content

Commit

Permalink
all: min Go version is 1.19, build with 1.20 (peak#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
igungor authored Jul 28, 2023
1 parent 065c3cf commit f9453a4
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 76 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:
matrix:
go-version:
- 1.20.x
- 1.19.x
os:
- ubuntu

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#### Improvements
- Implemented concurrent multipart download support for `cat`. ([#245](https://github.com/peak/s5cmd/issues/245))
- Upgraded minimum required Go version to 1.19. ([#583](https://github.com/peak/s5cmd/pull/583))

#### Bugfixes
- Fixed a bug introduced with `external sort` support in `sync` command which prevents `sync` to an empty destination with `--delete` option. ([#576](https://github.com/peak/s5cmd/issues/576))
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-alpine as build
FROM golang:1.20-alpine as build
COPY . /s5cmd/
RUN apk add --no-cache git make && \
cd /s5cmd/ && \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ make install clean
### Build from source
You can build `s5cmd` from source if you have [Go](https://golang.org/dl/) 1.17+
You can build `s5cmd` from source if you have [Go](https://golang.org/dl/) 1.19+
installed.
go install github.com/peak/s5cmd/v2@master
Expand Down
21 changes: 0 additions & 21 deletions atomic/bool.go

This file was deleted.

32 changes: 0 additions & 32 deletions atomic/bool_test.go

This file was deleted.

6 changes: 3 additions & 3 deletions command/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"errors"
"sync"
"sync/atomic"

"github.com/peak/s5cmd/v2/atomic"
"github.com/peak/s5cmd/v2/storage"
"github.com/peak/s5cmd/v2/storage/url"
)
Expand Down Expand Up @@ -81,13 +81,13 @@ func expandSources(
continue
}
ch <- object
objFound.Set(true)
objFound.Store(true)
}
}(origSrc)
}

wg.Wait()
if !objFound.Get() {
if !objFound.Load() {
ch <- &storage.Object{Err: storage.ErrNoObjectFound}
}
}()
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/peak/s5cmd/v2

go 1.17
go 1.19

require (
github.com/aws/aws-sdk-go v1.44.256
Expand Down
3 changes: 0 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
github.com/aws/aws-sdk-go v1.44.256 h1:O8VH+bJqgLDguqkH/xQBFz5o/YheeZqgcOYIgsTVWY4=
Expand Down Expand Up @@ -46,7 +45,6 @@ github.com/lanrat/extsort v1.0.0/go.mod h1:bkDEvem4UnD1h87yKICydXs63mKrIGW3W9OGP
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
Expand Down Expand Up @@ -150,6 +148,5 @@ gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce h1:xcEWjVhvbDy+nHP67nPDDpbYrY
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
14 changes: 1 addition & 13 deletions storage/url/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ func WithAllVersions(isAllVersions bool) Option {

// New creates a new URL from given path string.
func New(s string, opts ...Option) (*URL, error) {
// TODO Change strCut to strings.Cut when minimum required Go version is 1.18
scheme, rest, isFound := strCut(s, "://")
scheme, rest, isFound := strings.Cut(s, "://")
if !isFound {
url := &URL{
Type: localObject,
Expand Down Expand Up @@ -137,17 +136,6 @@ func New(s string, opts ...Option) (*URL, error) {
return url, nil
}

// strCut slices s around the first instance of sep,
// returning the text before and after sep.
// The found result reports whether sep appears in s.
// If sep does not appear in s, cut returns s, "", false.
func strCut(s string, sep string) (before string, after string, isFound bool) {
if i := strings.Index(s, sep); i >= 0 {
return s[:i], s[i+len(sep):], true
}
return s, "", false
}

// IsRemote reports whether the object is stored on a remote storage system.
func (u *URL) IsRemote() bool {
return u.Type == remoteObject
Expand Down

0 comments on commit f9453a4

Please sign in to comment.