This little Go package provides a function
This function tells whether the Go program is running in a headless environment.
isheadless.IsHeadless() always returns
(Note that this is not correct as it ignores the edge case of running on Windows 10 IoT Core headless.)
On all other systems,
false if an environment variable named
The behavior is the same as with Java's
DISPLAYis unset or set but empty,
DISPLAYis set and non-empty,
- Currently, this function always returns
falseon Windows. The fact that Windows 10 IoT Core can be headless is ignored and unsupported.
- Currently, this function does not support Android.
On Android, it will always return
true, no matter whether this is headless Android or "normal" Android.
- Currently, this function always inspects the
DISPLAYvariable on all other operating systems, assuming X11 or an equivalent. This is wrong on those operating systems which provide a UI through means independent of a