Glaze brings WebView apps to Go without CGo

Glaze, a lightweight Go toolkit, lets developers open native desktop windows that display HTML content without touching CGo or bundling native libraries. Built by developer Carlos Gimenes, it leverages each operating system’s built-in WebView—WKWebView on macOS, WebKitGTK on Linux, and WebView2 on Windows—through direct Go bindings created with purego.
A simpler path for small desktop tools
Many Go developers write small utilities that need a basic interface but don’t justify a full GUI framework. HTML offers layout, text rendering, forms, and familiar debugging, yet shipping a web server just for the UI feels heavy. Glaze strikes a middle ground: a native window around local HTML, called straight from Go code. No extra build tooling, no C compiler in the path, and no large framework dependencies—just Go making system calls.
How it works and what it includes
Glaze uses purego to call platform WebView APIs directly, so each backend talks to the system component already present on the machine. The API is minimal: create a window, set HTML content, expose JavaScript-to-Go bindings, and run the main loop. A sample program opens a titled window and renders a simple heading. For developers with existing net/http handlers, an AppWindow helper turns a web server into a desktop app with only a few lines of code, letting them reuse routes and middleware without rewriting the UI layer.
The trade-off of staying small
Glaze isn’t a full desktop GUI toolkit; it focuses on the window, the WebView, and a handful of helpers for small tools. That intentional narrowness keeps builds fast, dependencies light, and the workflow close to standard Go development. For projects that need more than HTML in a native window, heavier frameworks remain the better choice. But for quick dashboards, forms, or data inspectors, Glaze offers a straightforward way to get a desktop presence without leaving the Go ecosystem.
Source: DEV Community. AI-assisted editorial synthesis — TechnoExpress.

