aboutsummaryrefslogtreecommitdiffstats
path: root/config/general.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-08-23 21:36:23 +0200
committerRobin Jarry <robin@jarry.cc>2023-08-27 18:44:12 +0200
commita5bc7ccf0cae608ac1e72ab4c9ebe5596eb8c988 (patch)
treebe2e5f55fc21980489dca61947ea6b9819853ec3 /config/general.go
parentfff16640ad7cd8c4b73187fbce10f2aa558701be (diff)
downloadaerc-a5bc7ccf0cae608ac1e72ab4c9ebe5596eb8c988.tar.gz
xdg: get rid of deprecated dependencies
github.com/mitchellh/go-homedir has not received any update since 2019. The last release of github.com/kyoh86/xdg was in 2020 and it has been marked as deprecated by its author. Replace these with internal functions. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'config/general.go')
-rw-r--r--config/general.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/config/general.go b/config/general.go
index 65c20cfd..f4149583 100644
--- a/config/general.go
+++ b/config/general.go
@@ -4,10 +4,10 @@ import (
"fmt"
"os"
+ "git.sr.ht/~rjarry/aerc/lib/xdg"
"git.sr.ht/~rjarry/aerc/log"
"github.com/go-ini/ini"
"github.com/mattn/go-isatty"
- "github.com/mitchellh/go-homedir"
)
type GeneralConfig struct {
@@ -34,10 +34,8 @@ func parseGeneral(file *ini.File) error {
// redirected to file, force TRACE level
General.LogLevel = log.TRACE
} else if General.LogFile != "" {
- path, err := homedir.Expand(General.LogFile)
- if err != nil {
- return fmt.Errorf("log-file: %w", err)
- }
+ var err error
+ path := xdg.ExpandHome(General.LogFile)
logFile, err = os.OpenFile(path,
os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0o600)
if err != nil {