diff options
| author | joesis | 2019-01-30 09:48:07 +0800 |
|---|---|---|
| committer | GitHub | 2019-01-30 09:48:07 +0800 |
| commit | 0daad7b8e5bd9533578e674141123f6a264a7454 (patch) | |
| tree | d4ead088f7f71a1136067e328f688718e63aa8bf | |
| parent | eaad7114094d8a1b1b7188c062fa7f0fe21ac9b0 (diff) | |
| parent | c7802de1542f2014d9fd6a3f1a1d4701b6f7ebba (diff) | |
| download | systray-0daad7b8e5bd9533578e674141123f6a264a7454.tar.bz2 | |
Merge pull request #81 from michaelsanford/master
Document cross-platform console window details
| -rw-r--r-- | README.md | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -44,6 +44,34 @@ go get go run main.go ``` +## Building and the Console Window + +By default, the binary created by `go build` will cause a console window to be opened on both Windows and macOS when run. + +### Windows + +To prevent launching a console window when running on Windows, add these command-line build flags: + +```sh +go build -ldflags -H=windowsgui +``` + +### macOS + +On macOS, you will need to create an application bundle to wrap the binary; simply folders with the following minimal structure and assets: + +``` +SystrayApp.app/ + Contents/ + Info.plist + MacOS/ + go-executable + Resources/ + SystrayApp.icns +``` + +Consult the [Official Apple Documentation here](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1). + ## Credits - https://github.com/xilp/systray |
