Reputation: 41
could someone enlighten me on how to get simple import statements in vsc to work for an example main.go file I borrowed from somewhere? The following observations apply:
go: finding module for package fyne.io/fyne/v2/app go: finding module for package fyne.io/fyne/v2 go: finding module for package fyne.io/fyne/v2/container go: finding module for package fyne.io/fyne/v2/canvas go: found fyne.io/fyne/v2 in fyne.io/fyne/v2 v2.1.2 go: found fyne.io/fyne/v2/app in fyne.io/fyne/v2 v2.1.2 go: found fyne.io/fyne/v2/canvas in fyne.io/fyne/v2 v2.1.2 go: found fyne.io/fyne/v2/container in fyne.io/fyne/v2 v2.1.2
So it seems that everything thats needed is there and I can subsequently run the program.
Looked at all kinds of documentation but have no clue of whats exactly the problem and how to solve this.
Thanks in advance
Peter
Upvotes: 0
Views: 1055
Reputation: 1398
Your dependencies should be located in the right place, i.e. where the build tool, in this case vsc is expecting them. So move them there, and set your GOPATH
correctly as explained here: https://www.c-sharpcorner.com/article/how-to-setup-golang-with-vscode/
Upvotes: 0