Skip to content

Commit

Permalink
Remove unnecessary homedir module (#88)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
RedbackThomson authored Jun 10, 2021
1 parent cac5654 commit 8988516
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cmd/ack-generate/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"os"
"path/filepath"

"github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -62,7 +61,7 @@ func init() {
os.Exit(1)
}

hd, err := homedir.Dir()
hd, err := os.UserHomeDir()
if err != nil {
fmt.Printf("unable to determine $HOME: %s\n", err)
os.Exit(1)
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
github.com/gertd/go-pluralize v0.1.1
github.com/ghodss/yaml v1.0.0
github.com/iancoleman/strcase v0.1.3
github.com/mitchellh/go-homedir v1.1.0
github.com/operator-framework/api v0.6.0
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.1.1
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if ! k8s_controller_gen_version_equals "$CONTROLLER_TOOLS_VERSION"; then
exit 1
fi

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

0 comments on commit 8988516

Please sign in to comment.