aboutsummaryrefslogtreecommitdiffstats
path: root/config/config.go
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2022-07-31 15:15:27 +0200
committerRobin Jarry <robin@jarry.cc>2022-08-04 21:58:04 +0200
commit70bfcfef42578079f211d87cddc49519ee3503dc (patch)
treeae35c38e3980c73af2b43be10fe8cc9ece4f3f9a /config/config.go
parent978d35d356e8752bdd272884df48a6289d88b40a (diff)
downloadaerc-70bfcfef42578079f211d87cddc49519ee3503dc.tar.gz
lint: work nicely with wrapped errors (errorlint)
Error wrapping as introduced in Go 1.13 adds some additional logic to use for comparing errors and adding information to it. Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config/config.go')
-rw-r--r--config/config.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/config/config.go b/config/config.go
index de34e438..66c6dd19 100644
--- a/config/config.go
+++ b/config/config.go
@@ -128,7 +128,7 @@ func (c RemoteConfig) ConnectionString() (string, error) {
cmd.Stdin = os.Stdin
output, err := cmd.Output()
if err != nil {
- return "", fmt.Errorf("failed to read password: %s", err)
+ return "", fmt.Errorf("failed to read password: %w", err)
}
pw := strings.TrimSpace(string(output))
@@ -344,13 +344,13 @@ func loadAccountConfig(path string) ([]AccountConfig, error) {
source, err := sourceRemoteConfig.ConnectionString()
if err != nil {
- return nil, fmt.Errorf("Invalid source credentials for %s: %s", _sec, err)
+ return nil, fmt.Errorf("Invalid source credentials for %s: %w", _sec, err)
}
account.Source = source
_, err = account.Outgoing.parseValue()
if err != nil {
- return nil, fmt.Errorf("Invalid outgoing credentials for %s: %s", _sec, err)
+ return nil, fmt.Errorf("Invalid outgoing credentials for %s: %w", _sec, err)
}
accounts = append(accounts, account)
@@ -1027,7 +1027,7 @@ func (ui *UIConfig) loadStyleSet(styleSetDirs []string) error {
ui.style = NewStyleSet()
err := ui.style.LoadStyleSet(ui.StyleSetName, styleSetDirs)
if err != nil {
- return fmt.Errorf("Unable to load default styleset: %s", err)
+ return fmt.Errorf("Unable to load default styleset: %w", err)
}
return nil