I hereby claim:
- I am dtoebe on github.
- I am dtoebe (https://keybase.io/dtoebe) on keybase.
- I have a public key whose fingerprint is 6104 212E E4AE 792F 061F A5E8 FCCC A6A4 DC5D BC1F
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| // ./sample-data/main.go | |
| package main | |
| import "fmt" | |
| func main() { | |
| fmt.Println("Hello from the binary") | |
| } |
| // ./generators/generator.go | |
| package main | |
| //Much of this file is from http://stackoverflow.com/questions/17796043/golang-embedding-text-file-into-compiled-executable | |
| import ( | |
| "fmt" | |
| "io/ioutil" |
| // ./main.go | |
| package main | |
| import "os" | |
| // When we run `go generate` from the cli it will run the | |
| // `go run` command outlined below | |
| // **Important: sure to include the comment below for the generator to see** | |
| //go:generate go run generators/generator.go |
| //main.go | |
| package main | |
| import ( | |
| "fmt" | |
| "image" | |
| "image/color" | |
| "image/draw" | |
| "image/png" | |
| "math/rand" |
| //main.go | |
| package main | |
| import (...) | |
| func main() { | |
| // Seed the std random number generator | |
| rand.Seed(time.Now().UTC().UnixNano()) | |
| // We will leave out creating the png image file since we |
| //main.go | |
| ... | |
| func main() { | |
| ... | |
| for ... {...} | |
| // Here we allocate and create a buffer that can easily be | |
| // turned into a []byte |
| // main.go | |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "github.com/atotto/clipboard" | |
| "github.com/russross/blackfriday" |
| //main.go | |
| ... | |
| func run() error { | |
| engine := qml.NewEngine() //Create the QML engine | |
| engine.On("quit", func() { os.Exit(0) }) //If quit is called from QML the Golang program will gracefully quit | |
| component, err := engine.LoadFile("assets/main.qml") //Load the QML file | |
| if err != nil { |
| //assets/main.qml | |
| import QtQuick 2.3 //Needed to import all base QML entities | |
| import QtQuick.Controls 1.4 //Needed for ApplicationWindow and TextArea | |
| import QtQuick.Layouts 1.0 //For the RowLayout | |
| ApplicationWindow { //The base entity so we can set a toolbar later and the layout | |
| width: 640 //Default width | |
| height: 480 //Default height | |
| color: "#f1f1f1" //Background Color |