Created
February 3, 2017 18:04
-
-
Save grv87/6be3c9d7e1c795636a65283c5187d724 to your computer and use it in GitHub Desktop.
go-symlink
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM All OK | |
go run test.go | |
REM Create link with full path | |
mklink /J link "\\?\%cd%" | |
REM Test new link. Gives something like that: | |
REM <JUNCTION> link [\\?\R:\!spikes\go-symlink] | |
dir *link* | |
cd link | |
REM But under the link it goes wrong... | |
go run test.go |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"path/filepath" | |
) | |
func main() { | |
SourcePath, err := filepath.EvalSymlinks(".") | |
fmt.Println(SourcePath) | |
fmt.Println(err) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment