termcolor icon indicating copy to clipboard operation
termcolor copied to clipboard

go get termcolor fails with powershell, respctively windows env

Open jagottsicher opened this issue 3 years ago • 0 comments

Both command line and powershell (windows 10) do not allow me to go get the package.

go get github.com/efekarakus/termcolor
# github.com/efekarakus/termcolor
..\..\go\pkg\mod\github.com\efekarakus\[email protected]\termcolor.go:80:21: undefined: lookupWindows

on Linux/bash all works fine

I prepared me a make file, only windows fails:

make
GOARCH=amd64 GOOS=darwin go build -o ../bin/macos/turn ./src/turn.go
GOARCH=amd64 GOOS=linux go build -o ../bin/linux/turn ./src/turn.go
GOARCH=amd64 GOOS=windows go build -o ../bin/windows/turn.exe ./src/turn.go
# github.com/efekarakus/termcolor
../../go/src/github.com/efekarakus/termcolor/termcolor.go:80:21: undefined: lookupWindows
make: *** [Makefile:6: build] Fehler 2

seems lookupWindows() in version_windows.go but there it does not work properly, when I try "cross compiling". The "problem is, that the identifier in version.go (non-windows) and version_windows.go (windows terminal cmd and powershell) are NOT the same.

In version_windows.go it is called "windowsLevel" but it is nowhere called within termcolor. I corrected that, all compiles find then, colors are correctly determinated.

jagottsicher avatar Sep 29 '22 02:09 jagottsicher