Skip to content

Commit

Permalink
Merge pull request #9566 from hjiawei/use-stdlib-homedir
Browse files Browse the repository at this point in the history
Use Go stdlib to get user home directory
  • Loading branch information
hjiawei authored Dec 5, 2024
2 parents 0ed2982 + b2fb8eb commit bfcaebb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions felix/cmd/calico-bpf/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"fmt"
"os"

homedir "github.com/mitchellh/go-homedir"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -67,7 +66,7 @@ func initConfig() {
viper.SetConfigFile(cfgFile)
} else {
// Find home directory.
home, err := homedir.Dir()
home, err := os.UserHomeDir()
if err != nil {
fmt.Println(err)
os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ require (
github.com/libp2p/go-reuseport v0.4.0
github.com/mcuadros/go-version v0.0.0-20190830083331-035f6764e8d2
github.com/mipearson/rfw v0.0.0-20170619235010-6f0a6f3266ba
github.com/mitchellh/go-homedir v1.1.0
github.com/natefinch/atomic v1.0.1
github.com/nmrshll/go-cp v0.0.0-20180115193924-61436d3b7cfa
github.com/olekukonko/tablewriter v0.0.5
Expand Down Expand Up @@ -210,6 +209,7 @@ require (
github.com/mdlayher/genetlink v1.0.0 // indirect
github.com/mdlayher/netlink v1.1.0 // indirect
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/spdystream v0.2.0 // indirect
Expand Down

0 comments on commit bfcaebb

Please sign in to comment.