refactor: replace golang.org/x/exp/slices with stdlib
Some checks failed
Release / changelog (push) Has been cancelled
Release / artifacts (push) Has been cancelled
Release / msi (arm64) (push) Has been cancelled
Release / msi (x64) (push) Has been cancelled
Release / msi (x86) (push) Has been cancelled
Release / release (push) Has been cancelled

The experimental functions in `golang.org/x/exp/slices` are now
available in the standard library in Go 1.21 [1].

[1]: https://go.dev/doc/go1.21#slices

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
Eng Zer Jun 2025-01-14 00:48:38 +08:00 committed by Jan De Dobbeleer
parent 3d2d8ef850
commit bc4b991765
2 changed files with 2 additions and 2 deletions

View file

@ -39,7 +39,6 @@ require (
github.com/pelletier/go-toml/v2 v2.2.3 github.com/pelletier/go-toml/v2 v2.2.3
github.com/spf13/cobra v1.8.1 github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5 github.com/spf13/pflag v1.0.5
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67
golang.org/x/mod v0.22.0 golang.org/x/mod v0.22.0
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
) )
@ -86,6 +85,7 @@ require (
github.com/shopspring/decimal v1.4.0 // indirect github.com/shopspring/decimal v1.4.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/zclconf/go-cty v1.15.1 // indirect github.com/zclconf/go-cty v1.15.1 // indirect
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
golang.org/x/sync v0.10.0 // indirect golang.org/x/sync v0.10.0 // indirect
golang.org/x/tools v0.28.0 // indirect golang.org/x/tools v0.28.0 // indirect
) )

View file

@ -5,12 +5,12 @@ import (
"encoding/xml" "encoding/xml"
"fmt" "fmt"
"path/filepath" "path/filepath"
"slices"
"strings" "strings"
"github.com/jandedobbeleer/oh-my-posh/src/log" "github.com/jandedobbeleer/oh-my-posh/src/log"
"github.com/jandedobbeleer/oh-my-posh/src/properties" "github.com/jandedobbeleer/oh-my-posh/src/properties"
"github.com/jandedobbeleer/oh-my-posh/src/regex" "github.com/jandedobbeleer/oh-my-posh/src/regex"
"golang.org/x/exp/slices"
yaml "github.com/goccy/go-yaml" yaml "github.com/goccy/go-yaml"
toml "github.com/pelletier/go-toml/v2" toml "github.com/pelletier/go-toml/v2"