Skip to content

Instantly share code, notes, and snippets.

View GrimTheReaper's full-sized avatar
☠️
Literally dead

Grim GrimTheReaper

☠️
Literally dead
  • Hiding in a panic room.
View GitHub Profile
@GrimTheReaper
GrimTheReaper / opened.go
Last active November 18, 2019 16:50
This package will tell you whether or not a golang application was opened in the terminal. Very useful for `fyne` or any other UI libs, when you plan on having both a GUI and a CLI. We're using this to make an app that can be used heedlessly, for the advanced users, and with a GUI using fyne so the less experienced users can use the tool too.
// +build windows
package opened
import (
"syscall"
"unsafe"
)
// <Unsafe>