'Golang syscall.NewLazyDLL in Linux

Is there any way to load the syscall.NewLazyDLL in Ubuntu?

I tried:

GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -o myFileName *.go

but the syscall.NewLazyDLL is not found.

var (
    mod               = syscall.NewLazyDLL("user32.dll")
    procGetWindowText = mod.NewProc("GetWindowTextW")
)

My goal is to load the "windows" syscall functions, but from my main Ubuntu OS, so I dont need to switch to Windows to code. Is there any way Ubuntu can call the Windows functions from syscall.NewLazyDLL or do I have to write code in Windows for this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source