Skip to content

Commit

Permalink
Specify Earthly version; go 1.20 (#19)
Browse files Browse the repository at this point in the history
Earthly file versions specified as 0.6. Upgrading Go version in build to 1.20, though no new features are used.
  • Loading branch information
dangermike authored Feb 22, 2023
1 parent 1d6ecfa commit 08fc956
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run:
go: "1.17"
go: "1.20"
timeout: 5m
issues-exit-code: 1
tests: true
Expand Down
6 changes: 4 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM golang:1.18
VERSION 0.6

FROM golang:1.20

all-bench:
BUILD +fmt-bench
Expand Down Expand Up @@ -259,7 +261,7 @@ goveralls:
golangci-lint:
RUN echo Installing golangci-lint...
# see https://golangci-lint.run/usage/install/#other-ci
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /go/bin v1.45.0
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /go/bin v1.51.2
SAVE ARTIFACT /go/bin/golangci-lint /go/bin/golangci-lint

junit-report:
Expand Down
2 changes: 1 addition & 1 deletion bench/lazylru_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (bc benchconfig) Generic(b *testing.B) {
}

func (bc benchconfig) GenInterface(b *testing.B) {
lru := lazylruT.New(bc.capacity, time.Minute)
lru := lazylruT.New(bc.capacity, time.Minute) //nolint:staticcheck
defer lru.Close()
for i := 0; i < bc.keyCount; i++ {
lru.Set(keys[i], i)
Expand Down
2 changes: 1 addition & 1 deletion bench/null_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type nullCache struct{}
// NullCache is a cache that holds nothing and returns nothing
var NullCache = nullCache{}

// Get always returns `nil, false``
// Get always returns `nil, false
func (nc nullCache) Get(key string) (string, bool) {
return "", false
}
Expand Down
2 changes: 1 addition & 1 deletion generic/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run:
go: "1.18"
go: "1.20"
timeout: 5m
issues-exit-code: 1
tests: true
Expand Down
15 changes: 8 additions & 7 deletions generic/Earthfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
VERSION 0.6
FROM golang:rc-buster

WORKDIR /app
Expand Down Expand Up @@ -34,9 +35,8 @@ vendor:

lint:
FROM +vendor
COPY +revive/go/bin/revive /go/bin/revive
RUN echo Running revive...
RUN revive -exclude vendor/... -config revive.toml ./...
COPY +golangci-lint/go/bin/golangci-lint /go/bin/golangci-lint
RUN golangci-lint run

vet:
FROM +vendor
Expand All @@ -53,10 +53,11 @@ test:
RUN cat test-results/go-test-generic.out | $GOPATH/bin/go-junit-report > test-results/go-test-generic-report.xml
SAVE ARTIFACT test-results files

revive:
RUN echo Installing revive...
RUN 2>/dev/null go install github.com/mgechev/revive@latest
SAVE ARTIFACT /go/bin/revive /go/bin/revive
golangci-lint:
RUN echo Installing golangci-lint...
# see https://golangci-lint.run/usage/install/#other-ci
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /go/bin v1.51.2
SAVE ARTIFACT /go/bin/golangci-lint /go/bin/golangci-lint

junit-report:
RUN go install github.com/jstemmer/go-junit-report@latest
Expand Down
1 change: 0 additions & 1 deletion generic/containers/heap/heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// ordering for the Less method, so Push adds items while Pop removes the
// highest-priority item from the queue. The Examples include such an
// implementation; the file example_pq_test.go has the complete source.
//
package heap

import "sort"
Expand Down
8 changes: 5 additions & 3 deletions generic/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/TriggerMail/lazylru/generic

go 1.18
go 1.20

require (
github.com/stretchr/testify v1.8.1
Expand All @@ -9,8 +9,10 @@ require (

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.3.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/zeebo/assert v1.3.1 // indirect
golang.org/x/sys v0.5.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
12 changes: 7 additions & 5 deletions generic/go.sum
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/klauspost/cpuid/v2 v2.1.0 h1:eyi1Ad2aNJMW95zcSbmGg7Cg6cq3ADwLpMAP96d8rF0=
github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/klauspost/cpuid/v2 v2.2.1 h1:U33DW0aiEj633gHYw3LoDNfkDiYnE5Q8M/TKJn2f2jI=
github.com/klauspost/cpuid/v2 v2.2.1/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk=
github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.1 h1:vukIABvugfNMZMQO1ABsyQDJDTVQbn+LWSMy1ol1h6A=
github.com/zeebo/assert v1.3.1/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
7 changes: 7 additions & 0 deletions generic/lazylru_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ type value struct {
b byte
}

var _ = value{
x: nil,
s: "xyzzy",
v: 123,
b: 123,
}

var keys = func() []string {
k := make([]string, keycnt)

Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module github.com/TriggerMail/lazylru

go 1.17
go 1.20

require github.com/stretchr/testify v1.8.1

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
2 changes: 1 addition & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
Expand Down

0 comments on commit 08fc956

Please sign in to comment.