MyGo
MyGo documentation

Overview

MyGo documentation

MyGo builds desktop apps with Go and a web frontend. Windows show your pages in the webview of the operating system (WKWebView on macOS, WebKitGTK on Linux, WebView2 on Windows) instead of a bundled browser, so an app is a single Go program of a few megabytes. The frontend calls your Go code through a TypeScript client that MyGo generates from it, with the types of your Go structs and the documentation of your methods.

type Greeter struct{}

// Greet returns a greeting.
func (Greeter) Greet(name string) string { return "Hello, " + name }

func main() {
	mygo.Bind(Greeter{})
	mygo.App.WhenReady(func() {
		mygo.NewWindow(mygo.WindowOptions{Title: "Hello", URL: "/"})
	})
	if err := mygo.App.Run(); err != nil {
		log.Fatal(err)
	}
}
import { Greeter } from "./mygo"; // generated

document.body.textContent = await Greeter.greet("Ada");

Guides

Reference

Requirements

To develop apps you need Go 1.27 or later and, for the frontend tooling of new projects, Bun. MyGo uses no cgo, so there is no C toolchain to install, and any machine can compile the apps of every platform; signing and disk images of macOS apps need a Mac.

Apps run on:

Platform Needs
macOS 12 or later nothing: WKWebView is part of macOS
Linux (x64, arm64) GTK 3 and WebKitGTK 4.1 (or 4.0): libwebkit2gtk-4.1-0 on Debian and Ubuntu, webkit2gtk4.1 on Fedora. Tray icons also need libayatana-appindicator3.
Windows 10 and 11 (x64, arm64) the WebView2 Runtime, which Windows 11 includes

mygo doctor checks a development machine.