A small Go module for Windows that determines the type of a filesystem link (Symlink, Directory Symlink, Junction, etc.) by analyzing its reparse point attributes.
go get github.com/LogicDaemon/win32linktypespackage main
import (
"fmt"
"log"
"github.com/LogicDaemon/win32linktypes"
)
func main() {
linkType, err := win32linktypes.GetType("C:\\path\\to\\link")
if err != nil {
log.Fatalf("Error: %v", err)
}
fmt.Printf("Link type: %s\n", linkType)
// Output could be: "File Symlink", "Directory Symlink", "Junction", "Normal", etc.
}Ensure you are running on a Windows system with Developer Mode enabled or as Administrator (required for MKLINK usage).
Then simply run:
go test -v