Hello Everyone, I was using Ubuntu since 1 year but due to some compatibility issues i have shifted back to windows. Ubuntu doesn’t support many applications and windows doesn’t support golang correctly.
I am using Windows, i am developing programs which needed to be ran on CentOS Servers so i need to compile my program for Linux using set GOOS=linux but that is not an problem.
i am using gookit color which is a popular module for printing coloured text using the code color.White.Printf , i have followed the steps to install that module from github using go get. but the vs code is throwing me this error :
error while importing github.com/gookit/color: cannot find package
"golang.org/x/sys/windows" in any of:
C:\Program Files\Go\src\vendor\golang.org\x\sys\windows (vendor tree)
C:\Program Files\Go\src\golang.org\x\sys\windows (from $GOROOT)
C:\Users\91787\go\src\golang.org\x\sys\windows (from $GOPATH)
screenshot attached.
and while compiling, i ran these comands :
set GOOS=linux
go build -ldflags="-s -w" getpack_jet.go
and got this error :
C:\Program Files\Go\src\github.com\gookit\color\detect_windows.go:16:2: cannot find package "golang.org/x/sys/windows" in any of:
C:\Program Files\Go\src\vendor\golang.org\x\sys\windows (vendor tree)
C:\Program Files\Go\src\golang.org\x\sys\windows (from $GOROOT)
C:\Users\91787\go\src\golang.org\x\sys\windows (from $GOPATH)
any one would able to help me ? please