refactor: replace karma-go with standard error handling

This commit is contained in:
Manuel Rüger
2026-03-28 10:16:29 +01:00
parent e160121005
commit 0859bf4d08
12 changed files with 69 additions and 215 deletions

View File

@@ -2,12 +2,11 @@ package util
import (
"errors"
"fmt"
"io"
"net/url"
"os"
"strings"
"github.com/reconquest/karma-go"
)
type Credentials struct {
@@ -40,10 +39,7 @@ func GetCredentials(
if password == "-" {
stdin, err := io.ReadAll(os.Stdin)
if err != nil {
return nil, karma.Format(
err,
"unable to read password from stdin",
)
return nil, fmt.Errorf("unable to read password from stdin: %w", err)
}
password = strings.TrimSpace(string(stdin))
@@ -55,10 +51,7 @@ func GetCredentials(
url, err := url.Parse(targetURL)
if err != nil {
return nil, karma.Format(
err,
"unable to parse %q as url", targetURL,
)
return nil, fmt.Errorf("unable to parse %q as url: %w", targetURL, err)
}
if url.Host == "" && baseURL == "" {