Use new slices package from Go standard lib

This commit is contained in:
Deluan 2024-02-16 22:00:44 -05:00
parent 166eb37787
commit 97c7e5daaf
9 changed files with 9 additions and 10 deletions

View file

@ -8,13 +8,13 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"net/url" "net/url"
"slices"
"sort" "sort"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/log"
"golang.org/x/exp/slices"
) )
const ( const (

View file

@ -4,12 +4,12 @@ import (
"context" "context"
"database/sql" "database/sql"
"path/filepath" "path/filepath"
"slices"
"strings" "strings"
"github.com/navidrome/navidrome/consts" "github.com/navidrome/navidrome/consts"
"github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/log"
"github.com/pressly/goose/v3" "github.com/pressly/goose/v3"
"golang.org/x/exp/slices"
) )
func init() { func init() {

View file

@ -4,12 +4,12 @@ import (
"context" "context"
"database/sql" "database/sql"
"path/filepath" "path/filepath"
"slices"
"strings" "strings"
"github.com/navidrome/navidrome/consts" "github.com/navidrome/navidrome/consts"
"github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/log"
"github.com/pressly/goose/v3" "github.com/pressly/goose/v3"
"golang.org/x/exp/slices"
) )
func init() { func init() {

View file

@ -4,12 +4,12 @@ import (
"context" "context"
"database/sql" "database/sql"
"path/filepath" "path/filepath"
"slices"
"strings" "strings"
"github.com/navidrome/navidrome/consts" "github.com/navidrome/navidrome/consts"
"github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/log"
"github.com/pressly/goose/v3" "github.com/pressly/goose/v3"
"golang.org/x/exp/slices"
) )
func init() { func init() {

View file

@ -2,10 +2,10 @@ package model
import ( import (
"cmp" "cmp"
"slices"
"time" "time"
"github.com/navidrome/navidrome/utils/slice" "github.com/navidrome/navidrome/utils/slice"
"golang.org/x/exp/slices"
) )
type Album struct { type Album struct {

View file

@ -3,9 +3,8 @@ package model
import ( import (
"mime" "mime"
"path/filepath" "path/filepath"
"slices"
"strings" "strings"
"golang.org/x/exp/slices"
) )
var excludeAudioType = []string{ var excludeAudioType = []string{

View file

@ -5,6 +5,7 @@ import (
"encoding/json" "encoding/json"
"mime" "mime"
"path/filepath" "path/filepath"
"slices"
"sort" "sort"
"strings" "strings"
"time" "time"
@ -13,7 +14,6 @@ import (
"github.com/navidrome/navidrome/consts" "github.com/navidrome/navidrome/consts"
"github.com/navidrome/navidrome/utils" "github.com/navidrome/navidrome/utils"
"github.com/navidrome/navidrome/utils/slice" "github.com/navidrome/navidrome/utils/slice"
"golang.org/x/exp/slices"
) )
type MediaFile struct { type MediaFile struct {

View file

@ -2,12 +2,12 @@ package model
import ( import (
"fmt" "fmt"
"slices"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/navidrome/navidrome/model/criteria" "github.com/navidrome/navidrome/model/criteria"
"golang.org/x/exp/slices"
) )
type Playlist struct { type Playlist struct {

View file

@ -3,6 +3,7 @@ package metadata_test
import ( import (
"cmp" "cmp"
"encoding/json" "encoding/json"
"slices"
"github.com/navidrome/navidrome/conf" "github.com/navidrome/navidrome/conf"
"github.com/navidrome/navidrome/conf/configtest" "github.com/navidrome/navidrome/conf/configtest"
@ -13,7 +14,6 @@ import (
_ "github.com/navidrome/navidrome/scanner/metadata/taglib" _ "github.com/navidrome/navidrome/scanner/metadata/taglib"
. "github.com/onsi/ginkgo/v2" . "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega" . "github.com/onsi/gomega"
"golang.org/x/exp/slices"
) )
var _ = Describe("Tags", func() { var _ = Describe("Tags", func() {