Skip to content

Commit 43c0bb9

Browse files
vdemeestertekton-robot
authored andcommitted
refactor: use os.UserHomeDir instead of go-homedir
Let's use the built-in Go function instead of the library. It makes go-homedir an indirect dependency as it is still in-use by transitive dependency. Signed-off-by: Vincent Demeester <[email protected]>
1 parent 40fd892 commit 43c0bb9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/hashicorp/go-multierror v1.1.1
1414
github.com/hashicorp/golang-lru v1.0.2
1515
github.com/jenkins-x/go-scm v1.14.58
16-
github.com/mitchellh/go-homedir v1.1.0
16+
github.com/mitchellh/go-homedir v1.1.0 // indirect
1717
github.com/opencontainers/image-spec v1.1.1 // indirect
1818
github.com/pkg/errors v0.9.1
1919
github.com/sigstore/sigstore v1.9.4

pkg/credentials/writer/writer.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"sort"
2626
"strings"
2727

28-
"github.com/mitchellh/go-homedir"
2928
"github.com/tektoncd/pipeline/pkg/apis/pipeline"
3029
)
3130

@@ -71,7 +70,7 @@ func CopyCredsToHome(credPaths []string) error {
7170
return nil //nolint:nilerr // safe to ignore error; no credentials available to copy
7271
}
7372

74-
homepath, err := homedir.Dir()
73+
homepath, err := os.UserHomeDir()
7574
if err != nil {
7675
return fmt.Errorf("error getting the user's home directory: %w", err)
7776
}

0 commit comments

Comments
 (0)