diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..df67939 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/crazy-max/go-longpath-win + +go 1.20 diff --git a/main.go b/main.go new file mode 100644 index 0000000..a06500e --- /dev/null +++ b/main.go @@ -0,0 +1,22 @@ +//go:build windows +// +build windows + +package main + +import ( + "fmt" + "os" + "path/filepath" +) + +func main() { + tmpDir := os.TempDir() + wd, _ := os.Getwd() + fmt.Printf("TempDir: %s\n", tmpDir) + fmt.Printf("WorkingDir: %s\n", wd) + + tmpDirSym, _ := filepath.EvalSymlinks(tmpDir) + wdSym, _ := filepath.EvalSymlinks(wd) + fmt.Printf("TempDirEvalSymlinks: %s\n", tmpDirSym) + fmt.Printf("WorkingDirEvalSymlinks: %s\n", wdSym) +}