Fyne GUI Example does not compile

Hello Everyone

I am trying to add a GUI to my GoLang-Program and I thought Fyne (https://github.com/fyne-io/fyne) looks nice, so I installed it:

go get fyne.io/fyne/v2
 go get fyne.io/fyne/v2/cmd/fyne_demo/

Which worked fine. But then I tried to run the demo or one of their example-codes:

package main

import (

func main() {
	a := app.New()
	w := a.NewWindow("Hello")

	hello := widget.NewLabel("Hello Fyne!")
		widget.NewButton("Hi!", func() {
			hello.SetText("Welcome :)")


Now, when I try to compile it just nothing happens, it just compiles forever. I am using the GoLand IDE on Windows 10. My hardware is not top notch, but I don’t think that this is the issue…

Is there anything else I have to consider first before I can run Fyne? It also doesn’t need to be fyne, just a GUI Library that is not too hard to use.

Thank you guys for your help.



It worked for me on Win 10 compiling from the command line, but it took a couple of minutes during which antimalware was dominating the CPU usage, but that’s not unusual.

C:\Users\jeff.emanuel\novice\go\runfyne>go mod init runfyne
go: creating new go.mod: module runfyne
go: to add module requirements and sums:
        go mod tidy

C:\Users\jeff.emanuel\novice\go\runfyne>go mod tidy
go: finding module for package fyne.io/fyne/v2/container
go: finding module for package fyne.io/fyne/v2/app
go: finding module for package fyne.io/fyne/v2/widget
go: found fyne.io/fyne/v2/app in fyne.io/fyne/v2 v2.1.3
go: found fyne.io/fyne/v2/container in fyne.io/fyne/v2 v2.1.3
go: found fyne.io/fyne/v2/widget in fyne.io/fyne/v2 v2.1.3
go: downloading github.com/stretchr/testify v1.5.1
go: downloading github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564
go: downloading github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: downloading github.com/godbus/dbus/v5 v5.0.4
go: downloading golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
go: downloading github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff
go: downloading github.com/yuin/goldmark v1.3.8
go: downloading github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3
go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20211024062804-40e447a793be
go: downloading golang.org/x/image v0.0.0-20200430140353-33d19683fad8
go: downloading gopkg.in/yaml.v2 v2.2.8
go: downloading github.com/go-gl/gl v0.0.0-20210813123233-e4099ee2221f
go: downloading gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
go: downloading golang.org/x/text v0.3.3
go: downloading github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e

C:\Users\jeff.emanuel\novice\go\runfyne>go run runfyne.go