I want to make a Golang File For "Release".
This is my command:
go build -o testi.exe -ldflags "-H windowsgui"
What is the correct way? My code:
package main
import (
"fmt"
"os"
//"github.com/chai2010/qml"
"github.com/go-qml/qml"
)
func main() {
if err := qml.Run(run); err != nil {
fmt.Fprintf(os.Stderr, "error: %v
", err)
os.Exit(1)
}
}
func run() error {
engine := qml.NewEngine()
engine.On("quit", func() { os.Exit(0) })
component, err := engine.LoadString("hello.qml", qmlHello)
if err != nil {
return err
}
window := component.CreateWindow(nil)
window.Show()
window.Wait()
return nil
}
const qmlHello = `
import QtQuick 2.2
import QtQuick.Controls 1.1
Rectangle {
id: page
width: 320; height: 240
color: "lightgray"
Text {
id: helloText
text: "Hello world!"
y: 30
anchors.horizontalCenter: page.horizontalCenter
font.pointSize: 24; font.bold: true
}
}
`
I installed : go1.5.windows-386.