Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Rectify typo from #468 (+ go fmt) #478

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func CreateSymlink(cwd string, dir string) error {

// RemoveSymlink : remove symlink
func RemoveSymlink(symlinkPath string) error {

_, err := os.Lstat(symlinkPath)
if err != nil {
return fmt.Errorf(`
Expand Down Expand Up @@ -75,7 +74,6 @@ func RemoveSymlink(symlinkPath string) error {

// CheckSymlink : check file is symlink
func CheckSymlink(symlinkPath string) bool {

fi, err := os.Lstat(symlinkPath)
if err != nil {
return false
Expand All @@ -101,8 +99,7 @@ func ChangeSymlink(binVersionPath string, binPath string) {

// ChangeProductSymlink : move symlink for product to existing binary
func ChangeProductSymlink(product Product, binVersionPath string, userBinPath string) error {

homedir := GetHomeDirectory() //get user's home directory
homedir := GetHomeDirectory() // get user's home directory
homeBinPath := filepath.Join(homedir, "bin", product.GetExecutableName())
possibleInstallLocations := []string{userBinPath, homeBinPath}
var err error
Expand All @@ -126,7 +123,7 @@ func ChangeProductSymlink(product Product, binVersionPath string, userBinPath st

if err == nil {
return fmt.Errorf("Unable to find existing directory in %q. %s",
strings. Join(possibleInstallLocations, " or "),
strings.Join(possibleInstallLocations, " or "),
"Manually create one of them and try again.")
}

Expand Down