Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,25 @@ To develop apps using Fyne you will need Go version 1.17 or later, a C compiler
If you're not sure if that's all installed or you don't know how then check out our
[Getting Started](https://fyne.io/develop/) document.

Using the standard go tools you can install Fyne's core library using:
Using the standard go command you can add Fyne to your project by running two commands. First:

go get fyne.io/fyne/v2@latest

After importing a new module, run the following command before compiling the code for the first time. Avoid running it before writing code that uses the module to prevent accidental removal of dependencies:
If you are new to Go, it is important to know that (as of Go 1.18) `go get` only downloads the specified module (to an internal folder), and adds a mention to it in the current folder's `go.mod` file. It does not add that module's dependencies to the `go.mod` file. To do this requires running a second command.

go mod tidy
Before running this second command, there must be a reference to fyne in one of your project's source files. The following, works:

import "fyne.io/fyne/v2/app"

Note that:
* `import "fyne.io/fyne/v2"` does not work.

@Wallby Wallby Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the intended design of the individual fyne modules should be better explored. Mentioning @andydotxyz related to this comment #6418 (comment).

If the intended design is clearer, then this section could be rewritten before merging the pull request. Such that it is better defined whether the above is a workaround that works now, or defined behaviour that will continue to work always.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going far too much into the weeds - which packages can and cannot retain a go.mod reference with no code added is unimportant - what matters is the app using fyne before they call "go mod tidy"

* some tools (such as [the official Visual Studio Go extension](https://marketplace.visualstudio.com/items?itemName=golang.go)), automatically remove unused imports. In which case you'll have to also write some code that uses an imported fyne module.
Comment thread
andydotxyz marked this conversation as resolved.
Outdated

Now run the following command, which both adds missing dependencies and removes unused ones.

go mod tidy

Now you can build and run your application.

# Widget demo

Expand Down