Use filepath.Join instead of file.Join

This commit is contained in:
Philipp Wolfer 2025-05-24 00:37:05 +02:00
parent 142d38e9db
commit 34b6bb9aa3
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
2 changed files with 2 additions and 4 deletions

View file

@ -20,7 +20,6 @@ package spotifyhistory
import ( import (
"context" "context"
"os" "os"
"path"
"path/filepath" "path/filepath"
"slices" "slices"
"sort" "sort"
@ -74,7 +73,7 @@ func (b *SpotifyHistoryBackend) InitConfig(config *config.ServiceConfig) error {
} }
func (b *SpotifyHistoryBackend) ExportListens(ctx context.Context, oldestTimestamp time.Time, results chan models.ListensResult, progress chan models.TransferProgress) { func (b *SpotifyHistoryBackend) ExportListens(ctx context.Context, oldestTimestamp time.Time, results chan models.ListensResult, progress chan models.TransferProgress) {
files, err := filepath.Glob(path.Join(b.dirPath, historyFileGlob)) files, err := filepath.Glob(filepath.Join(b.dirPath, historyFileGlob))
p := models.TransferProgress{ p := models.TransferProgress{
Export: &models.Progress{}, Export: &models.Progress{},
} }

View file

@ -19,7 +19,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"os" "os"
"path"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strings" "strings"
@ -40,7 +39,7 @@ const (
func DefaultConfigDir() string { func DefaultConfigDir() string {
configDir, err := os.UserConfigDir() configDir, err := os.UserConfigDir()
cobra.CheckErr(err) cobra.CheckErr(err)
return path.Join(configDir, version.AppName) return filepath.Join(configDir, version.AppName)
} }
// initConfig reads in config file and ENV variables if set. // initConfig reads in config file and ENV variables if set.