Develop desktop apps with native UI or web frontend in Go
★ 6,357⑂ 402👁 17⑃ 1,397● 490▤ 82
+94
日增长
+782
周增长
6,357
stars
402
forks
17
watchers
1,397
prs
490
issues
82
releases
README
Desktop apps in Go, with native UI or a web frontend.
Sponsored by:
Become a sponsor
---
Each MyGo window shows one of two kinds of interface, and one app, or one
window, can mix them:
- A web page, in the webview the OS already has: WKWebView on macOS,
WebKitGTK on Linux, WebView2 on Windows. Build the frontend with any web
tools; it calls your Go code through a TypeScript client generated from it.
- Native UI, written in Go alone with package ui and
drawn by MyGo itself on the GPU: no HTML, no JavaScript and no webview, so
the window opens at once and takes little memory.
Either way, an app is a single Go binary of a few megabytes, focused on low
memory and CPU use.
- Pure Go, no cgo: build for every platform from any machine.
- Typed IPC for pages: bind Go services, stream values through channels
and send typed events; the TypeScript client is generated from your Go
code.
- A Go UI toolkit for native UI: flexbox and grid layout, widgets, text
editing with input methods, virtualized lists, SVG icons, animations,
screen reader support, and views you test without a window; Liquid Glass
on every platform with the glass plugin; web pages inside native UI, under
the menus and dialogs it shows over them.
- Desktop APIs for both: windows, menus, tray, dialogs, notifications,
global shortcuts, deep links, file associations, recent documents, Now
Playing and the media keys, the system accent color and accessibility
settings, watching files, and more.
- Ready to ship: app bundles and disk images, Windows installers, Debian
and RPM packages, PKGBUILDs for Arch Linux and a Linux install script, code signing, notarization, and signed
auto-updates with delta updates and an update window in the manner of
Sparkle.
A window with a web page, whose frontend calls Go:
go
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)
}
}
ts
import { Greeter } from "./mygo"; // generated
document.body.textContent = await Greeter.greet("Ada");
A window with native UI, whose view is a Go function of the app's state:
go
type counter struct{ n int }
func (s counter) view(c ui.Context) {
ui.Column(c).Fill().Center().Gap(12).Children(func() {
ui.Text(c, fmt.Sprint(s.n)).FontSize(40).Bold()
if ui.PrimaryButton(c, "Increment").Clicked() {
s.n++
}
})
}
func main() {
s := &counter{}
mygo.App.WhenReady(func() {
mygo.NewWindow(mygo.WindowOptions{
Title: "Counter",
Content: ui.View(s.view),
})
})
if err := mygo.App.Run(); err != nil {
log.Fatal(err)
}
}
Getting started
With Go 1.27.3+ and Bun, create an app
with a web frontend:
sh
bunx mygo-cli init my-app or: npx mygo-cli init my-app
cd my-app
bun run dev
ATop issues
#615Layout performance: where mygo's flexbox loses time on arewelayoutyet's workloads11 comments · 2026-10-21#1724richtext: attachments that are elements (block embeds), as ui/editor's replacements4 comments · 2026-11-11#1722ui: Testers can't run in parallel — they share the glyph atlas3 comments · 2026-11-11#1712Touchscreen support: one-finger drag should scroll (Windows / Linux)3 comments · 2026-11-11#1651editor: hide or replace ranges, elements between lines, and per-line text styles (Markdown live preview)3 comments · 2026-11-10#1902ui: each Tester's text system is never freed (one thread and font map per Tester since v0.9.1)2 comments · 2026-11-15#1862ui: let apps opt in to continuous corners on Windows and Linux (D3D11 / GL shaders)2 comments · 2026-11-14#1809ui/editor: how should an app determine a buffer's line-ending mode?2 comments · 2026-11-13
Latest release
MyGo 0.9.1 v0.9.1 2026-11-15Changes in behavior No breaking changes to the Go API. A few changes builds and apps may notice: - mygo build rejects update URLs with a query string or a fragment. Update URLs name a folder, and the CLI adds each file's name to the end, so https://example.com/app?token=x put the name in the query and shipped a feed that could not be read. Put the folder in the path instead. (1753, @everroam) - fileAssociations[].mimeType must be a plain type/subtype. Parameters, line breaks and other malformed names now fail the build instead of ending up in desktop entries. Valid types, including ones with