Go + Fyne Framework: Facing Package Issue, Seeking Assistance

96 Views Asked by At

Facing Errors for Specific Modules in Go with Fyne Framework error I'm encountering an issue with Fyne in Go. Despite having the latest versions of both Fyne and Go, I'm consistently facing a problem where modules, specifically 'fyne.io/fyne/v2/container/unit,' cannot be found. I've tried reinstalling multiple times without success. Seeking help to resolve this persistent module-related error.

Code:

package main

import (
    "fmt"
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/container"
    "fyne.io/fyne/v2/container/layout"
    "fyne.io/fyne/v2/widget"
)

func main() {
    myApp := app.New()
    myWindow := myApp.NewWindow("Hello Fyne")

    myButton := widget.NewButton("Click me!", func() {
        fmt.Println("Button Clicked!")
    })

    myContainer := container.New(
        layout.NewVBoxLayout(),
        layout.NewSpacer(), // Spacer to push the button to the center
        myButton,
        layout.NewSpacer(), // Spacer for better layout
    )

    myWindow.SetContent(myContainer)

    myWindow.ShowAndRun()
}

Updated Fyne and Go Versions, Installed Packages - Still Facing Specific Module Errors

1

There are 1 best solutions below

0
On

There is no such package as fyne.io/fyne/v2/container/unit and there never has been. This is not a packaging issue.