Skip to content

Commit

Permalink
Update to go 1.21 (#375)
Browse files Browse the repository at this point in the history
"slices" package is now part of the standard library
  • Loading branch information
asmaloney authored Aug 13, 2023
1 parent 22f5417 commit 11e3855
Show file tree
Hide file tree
Showing 59 changed files with 401 additions and 1,519 deletions.
3 changes: 1 addition & 2 deletions actr/buffer/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ package buffer

import (
"fmt"
"slices"
"strings"

"golang.org/x/exp/slices"

"github.com/asmaloney/gactar/actr/param"
"github.com/asmaloney/gactar/util/keyvalue"
)
Expand Down
2 changes: 1 addition & 1 deletion actr/chunk.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package actr

import (
"golang.org/x/exp/slices"
"slices"

"github.com/asmaloney/gactar/util/container"
)
Expand Down
2 changes: 1 addition & 1 deletion actr/logging.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package actr

import "golang.org/x/exp/slices"
import "slices"

type ACTRLogLevel string

Expand Down
3 changes: 1 addition & 2 deletions actr/modules/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
package modules

import (
"slices"
"strings"

"golang.org/x/exp/slices"

"github.com/asmaloney/gactar/actr/buffer"
"github.com/asmaloney/gactar/actr/param"

Expand Down
8 changes: 6 additions & 2 deletions actr/param/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package param

import (
"fmt"
"slices"
"strconv"
"strings"

"golang.org/x/exp/constraints"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"

"github.com/asmaloney/gactar/util/keyvalue"
"github.com/asmaloney/gactar/util/numbers"
Expand Down Expand Up @@ -186,7 +186,11 @@ func NewParameters(params List) ParametersInterface {
func (p parameters) ParameterList() List {
params := maps.Values(p.params)

slices.SortFunc[ParamInterface](params, func(a, b ParamInterface) bool { return a.Name() < b.Name() })
compareParamInterface := func(a, b ParamInterface) int {
return strings.Compare(a.Name(), b.Name())
}

slices.SortFunc(params, compareParamInterface)

return params
}
Expand Down
3 changes: 1 addition & 2 deletions amod/amod.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
"errors"
"fmt"
"reflect"
"slices"
"strconv"
"strings"

"golang.org/x/exp/slices"

"github.com/alecthomas/participle/v2"

"github.com/asmaloney/gactar/actr"
Expand Down
2 changes: 1 addition & 1 deletion amod/validate.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package amod

import (
"golang.org/x/exp/slices"
"slices"

"github.com/alecthomas/participle/v2/lexer"

Expand Down
3 changes: 1 addition & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import (
"fmt"
"os"
"path/filepath"
"slices"
"strings"

"golang.org/x/exp/slices"

"github.com/jwalton/gchalk"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand Down
3 changes: 1 addition & 2 deletions framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
package framework

import (
"slices"
"time"

"golang.org/x/exp/slices"

"github.com/asmaloney/gactar/actr"

"github.com/asmaloney/gactar/util/issues"
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/asmaloney/gactar

go 1.20
go 1.21

require (
github.com/alecthomas/participle/v2 v2.0.0
Expand All @@ -9,13 +9,13 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/vearutop/statigz v1.4.0
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
golang.org/x/term v0.10.0
golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb
golang.org/x/term v0.11.0
)

require (
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jwalton/go-supportscolor v1.1.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/sys v0.11.0 // indirect
)
20 changes: 14 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk=
github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g=
github.com/alecthomas/participle/v2 v2.0.0/go.mod h1:rAKZdJldHu8084ojcWevWAL8KmEU+AT+Olodb+WoN2Y=
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/bool64/dev v0.2.28 h1:6ayDfrB/jnNr2iQAZHI+uT3Qi6rErSbJYQs1y8rSrwM=
github.com/bool64/dev v0.2.28/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jwalton/gchalk v1.3.0 h1:uTfAaNexN8r0I9bioRTksuT8VGjrPs9YIXR1PQbtX/Q=
Expand All @@ -17,26 +22,29 @@ github.com/jwalton/go-supportscolor v1.1.0/go.mod h1:hFVUAZV2cWg+WFFC4v8pT2X/S2q
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
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/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/vearutop/statigz v1.4.0 h1:RQL0KG3j/uyA/PFpHeZ/L6l2ta920/MxlOAIGEOuwmU=
github.com/vearutop/statigz v1.4.0/go.mod h1:LYTolBLiz9oJISwiVKnOQoIwhO1LWX1A7OECawGS8XE=
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw=
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA=
golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c=
golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0=
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
3 changes: 1 addition & 2 deletions modes/web/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import (
"net/http"
"os"
"path"
"slices"
"sort"
"strconv"
"strings"
"sync"

"golang.org/x/exp/slices"

"github.com/jwalton/gchalk"
"github.com/vearutop/statigz"
"github.com/vearutop/statigz/brotli"
Expand Down
3 changes: 1 addition & 2 deletions util/keyvalue/keyvalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package keyvalue

import (
"fmt"
"slices"
"strings"

"golang.org/x/exp/slices"
)

var BooleanValues = []string{
Expand Down
Loading

0 comments on commit 11e3855

Please sign in to comment.