Development Setup
Development Environment Setup
Section titled “Development Environment Setup”This guide walks you through setting up a complete development environment for working on Wails v3.
Required Tools
Section titled “Required Tools”Go Development
Section titled “Go Development”-
Install Go 1.25 or later:
Terminal window # Download from https://go.dev/dl/go version # Verify installation -
Configure Go environment:
Terminal window # Add to your shell profile (.bashrc, .zshrc, etc.)export GOPATH=$HOME/goexport PATH=$PATH:$GOPATH/bin -
Install useful Go tools:
Terminal window go install golang.org/x/tools/cmd/goimports@latestgo install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
Node.js and npm
Section titled “Node.js and npm”Required for building documentation and testing frontend integrations.
# Install Node.js 20+ and npmnode --version # Should be 20+npm --versionPlatform-Specific Dependencies
Section titled “Platform-Specific Dependencies”macOS:
# Install Xcode Command Line Toolsxcode-select --install
# Verify installationxcode-select -p # Should output a pathWindows:
- Install MSYS2 for a Unix-like environment
- WebView2 Runtime (pre-installed on Windows 11, download for Windows 10)
- Optional: Install Git for Windows
Linux (Debian/Ubuntu):
sudo apt updatesudo apt install build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.0-devLinux (Fedora/RHEL):
sudo dnf install gcc pkg-config gtk3-devel webkit2gtk3-develLinux (Arch):
sudo pacman -S base-devel gtk3 webkit2gtkRepository Setup
Section titled “Repository Setup”Clone and Configure
Section titled “Clone and Configure”# Clone your forkgit clone https://github.com/YOUR_USERNAME/wails.gitcd wails
# Add upstream remotegit remote add upstream https://github.com/wailsapp/wails.git
# Verify remotesgit remote -vBuild the Wails CLI
Section titled “Build the Wails CLI”# Navigate to v3 directorycd v3
# Build the CLIgo build -o ../wails3 ./cmd/wails3
# Test the buildcd .../wails3 versionAdd to PATH (Optional)
Section titled “Add to PATH (Optional)”Linux/macOS:
# Add to ~/.bashrc or ~/.zshrcexport PATH=$PATH:/path/to/wailsWindows:
Add the Wails directory to your PATH environment variable through System Properties.
IDE Setup
Section titled “IDE Setup”VS Code (Recommended)
Section titled “VS Code (Recommended)”-
Install VS Code: Download
-
Install extensions:
- Go (by Go Team at Google)
- ESLint
- Prettier
- MDX (for documentation)
-
Configure workspace settings (
.vscode/settings.json):{"go.useLanguageServer": true,"go.lintTool": "golangci-lint","go.lintOnSave": "workspace","editor.formatOnSave": true,"go.formatTool": "goimports"}
GoLand
Section titled “GoLand”-
Install GoLand: Download
-
Configure:
- Enable Go modules support
- Set up file watchers for
goimports - Configure code style to match project conventions
Verify Your Setup
Section titled “Verify Your Setup”Run these commands to verify everything is working:
# Go version checkgo version
# Build Wailscd v3go build ./cmd/wails3
# Run testsgo test ./pkg/...
# Create a test appcd .../wails3 init -n mytest -t vanillacd mytest../wails3 devIf the test app builds and runs, your environment is ready!
Running Tests
Section titled “Running Tests”Unit Tests
Section titled “Unit Tests”cd v3go test ./...Specific Package Tests
Section titled “Specific Package Tests”go test ./pkg/applicationgo test ./pkg/events -v # Verbose outputRun with Coverage
Section titled “Run with Coverage”go test ./... -coverprofile=coverage.outgo tool cover -html=coverage.outRun with Race Detector
Section titled “Run with Race Detector”go test ./... -raceWorking with Documentation
Section titled “Working with Documentation”The Wails documentation is built with Astro and Starlight.
cd docs
# Install dependenciesnpm install
# Start dev servernpm run dev
# Build for productionnpm run buildDocumentation will be available at http://localhost:4321/
Debugging
Section titled “Debugging”Debugging Go Code
Section titled “Debugging Go Code”VS Code:
Create .vscode/launch.json:
{ "version": "0.2.0", "configurations": [ { "name": "Debug Wails CLI", "type": "go", "request": "launch", "mode": "debug", "program": "${workspaceFolder}/v3/cmd/wails3", "args": ["dev"] } ]}Command Line:
# Use Delve debuggergo install github.com/go-delve/delve/cmd/dlv@latestdlv debug ./cmd/wails3 -- devDebugging Platform Code
Section titled “Debugging Platform Code”Platform-specific debugging requires platform tools:
- macOS: Xcode Instruments
- Windows: Visual Studio Debugger
- Linux: GDB
Common Issues
Section titled “Common Issues””command not found: wails3”
Section titled “”command not found: wails3””Add the Wails directory to your PATH or use ./wails3 from the project root.
”webkit2gtk not found” (Linux)
Section titled “”webkit2gtk not found” (Linux)”Install WebKit2GTK development packages:
sudo apt install libwebkit2gtk-4.0-dev # Debian/UbuntuBuild fails with Go module errors
Section titled “Build fails with Go module errors”cd v3go mod tidygo mod download”CGO_ENABLED” errors on Windows
Section titled “”CGO_ENABLED” errors on Windows”Ensure you have a C compiler (MinGW-w64 via MSYS2) in your PATH.
Next Steps
Section titled “Next Steps”- Review Coding Standards
- Explore the Technical Documentation
- Find an issue to work on: Good First Issues