Open daonb opened 7 months ago
Reasonable. PR welcome :)
You need to make sure the relevant development headers are installed, which does not require X11 to be running. How to do that depends on the specific distribution you are using.
Second this. I am trying to use this package in a CLI I have created, but the CLI is designed to work on multiple platforms. Some of those platforms will not be able to use this package, but the CLI should still compile/run when it's being ran there. I am planning to use the clipboard.Init()
check to verify and warn the user if they are trying to use clipboard functionality when they cannot.
But for that, as OP stated, whether to terminate on such an error must be left to the application, not to the module.
I've just added you're excellent package to my project and it works great on my arm mac. When I try to run my docker compose based tests it fails to compile:
Makes sense - containers don't have X. I've tried disabling CGO and got in run time:
It's clear the package can't do anything on a system with no clipboard, but IMHO it should be able to compile and return an error on all calls, leaving it to the calling program to handle. Like in my program's, where I want to use an environment variable as the clipboard storage so I can run and validate clipboard related tests.