fatih / color

Color package for Go (golang)
https://pkg.go.dev/github.com/fatih/color
MIT License
7.26k stars 615 forks source link

Is not available as a dependency: IsCygwinTerminal #62

Closed NicolasSiver closed 7 years ago

NicolasSiver commented 7 years ago

Hello.

I'm trying to use color library v1.4.0 as a dependency via dep tool. It resolves dependencies well, but there is an issue with go-isatty dependency.

undefined: isatty.IsCygwinTerminal

As I understand, isatty is released with a tag which does not have the latest changes. https://github.com/mattn/go-isatty/tree/v0.0.1

fatih commented 7 years ago

Hi @NicolasSiver

I'm not sure what dep does under the hood. But If you go get this package it should just work. I've vendored the packages. Please do not strip the vendor dir. If you do, you're resonsible for the third part libraries and how the library vendors them. I think you should open a PR to go-isatty and ask them to tag it as there is little I can do. Thanks.

NicolasSiver commented 7 years ago

It looks like dep does not use vendor directory at all. I mean, I did not strip anything ;) If they are going to make dep as an official tool for package management, maybe vendor directory will not work well.

lgonzalez-silen commented 7 years ago

for others who hit this, the issue here is that the tags in go-isatty are slightly incorrect isatty_others.go).

Instead of

// +build !windows appengine

they should be

// +build !windows
// +build !appengine

and file isatty_appengine.go should implement IsCygwinTerminal.

To get around this we pinned to color 5ec5d9d3c2cf82e9688b34e9bc27a94d616a7193.

lgonzalez-silen commented 7 years ago

the tag appengine is recommended to be ignored in govendor, that's why isatty_others.go is not pulled in if you are ignoring appengine in your fetch/sync.

fatih commented 7 years ago

@lgonzalez-silen could you open a PR to isatty repo or open an issue there? I'm not sure I can do something here, or yes ?

lgonzalez-silen commented 7 years ago

Done! :-)

Yep, there is nothing to do here.

mattn commented 7 years ago

Sorry, my bad.