Skip to content

Commit 8988516

Browse files
Remove unnecessary homedir module (#88)
`os.UserHomeDir` is supported in go1.12+. We no longer need a third party module to load the home directory. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent cac5654 commit 8988516

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

cmd/ack-generate/command/root.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"os"
1919
"path/filepath"
2020

21-
"github.com/mitchellh/go-homedir"
2221
"github.com/spf13/cobra"
2322
)
2423

@@ -62,7 +61,7 @@ func init() {
6261
os.Exit(1)
6362
}
6463

65-
hd, err := homedir.Dir()
64+
hd, err := os.UserHomeDir()
6665
if err != nil {
6766
fmt.Printf("unable to determine $HOME: %s\n", err)
6867
os.Exit(1)

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ require (
1010
github.com/gertd/go-pluralize v0.1.1
1111
github.com/ghodss/yaml v1.0.0
1212
github.com/iancoleman/strcase v0.1.3
13-
github.com/mitchellh/go-homedir v1.1.0
1413
github.com/operator-framework/api v0.6.0
1514
github.com/pkg/errors v0.9.1
1615
github.com/spf13/cobra v1.1.1

scripts/build-controller.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if ! k8s_controller_gen_version_equals "$CONTROLLER_TOOLS_VERSION"; then
1919
exit 1
2020
fi
2121

22-
ACK_GENERATE_CACHE_DIR=${ACK_GENERATE_CACHE_DIR:-"~/.cache/aws-controllers-k8s"}
22+
ACK_GENERATE_CACHE_DIR=${ACK_GENERATE_CACHE_DIR:-"$HOME/.cache/aws-controllers-k8s"}
2323
# The ack-generate code generator is in a separate source code repository,
2424
# typically at $GOPATH/src/github.com/aws-controllers-k8s/code-generator
2525
DEFAULT_ACK_GENERATE_BIN_PATH="$ROOT_DIR/bin/ack-generate"

0 commit comments

Comments
 (0)