Simple: "no GO source files"

UPDATE: I restarted VSCode and tested my code again, then tried it from the command line. I got a really long error, which starts with :

Exception 0xc0000005 0x0 0x7ffbd991a0f0 0x7ff89943445e
signal arrived during external code execution

runtime.cgocall(0x7ff6ead942c0, 0xc000065da0)

and it ends with:

     C:/Program Files/Go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc01494dfe8 sp=0xc01494dfe0 pc=0x7ff6ea9c8ac1
created by os/signal.Notify.func1.1 in goroutine 55
        C:/Program Files/Go/src/os/signal/signal.go:151 +0x1f
rax     0xfff0fff
rbx     0xd075dff3a0
rcx     0x7ffbd991a0cc
rdi     0x7ff899c26100
rsi     0x2157c392b20
rbp     0xd075dfefb0
rsp     0xd075dfeea8
r8      0xd075dfefc0
r9      0xd075dff3a0
r10     0xd075dff190
r11     0x0
r12     0x100
r13     0x0
r14     0x1
r15     0x0
rip     0x7ff89943445e
rflags  0x10206
cs      0x33
fs      0x53
gs      0x2b
exit status 2

Any ideas? My code is pasted below, along with the original error I was getting.

Hi, new user here. I have a pretty simple setup with all code hosted in just one file, a go.mod file and go.sum file that don’t report errors in vscode.

When I try to run main.go, it says :

go: no Go source files

Also, when I hover over “main” in package main in main.go, it says :

This file is within module ".", which is not included in your workspace.
To fix this problem, you can add a file that uses this directory.
See the documentation for more information on setting up your workspace:

I’ve tried making that file and it removed the yellow squiggly line under “main”, but didn’t fix the issue, so I got rid of it.

Here’s the contents of main.go, which only reports one error (the yellow squiggly under main):

package main

import (


func Call2(someurl string) (*http.Response, error) {
	req, err := http.NewRequest(http.MethodGet, someurl, nil)
	if err != nil {
		fmt.Printf("Error creating request: %s", err)
		return nil, err
	client := http.Client{
		Timeout: 30 * time.Second,
	res, err := client.Do(req)
	if err != nil {
		fmt.Printf("Error making HTTP request: %s", err)
		return nil, err
	return res, nil

func tidyUp() {
func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("Hello")
	k, err := Call2("")
	if err != nil {
		fmt.Printf("Error making HTTP request: %s", err)
	defer k.Body.Close()
	b, err := io.ReadAll(k.Body)
	if err != nil {
		fmt.Printf("Error reading response body: %s", err)
	//	fmt.Println(string(b))

Here’s the contents of go.mod, which reports no errors according to vscode:

module novicemodule

go 1.21.3

require v2.4.1

require ( v1.10.1-0.20230722100817-88df1e0ffa9a // indirect v1.1.1 // indirect v1.0.0 // indirect v1.6.0 // indirect v0.0.0-20220119005834-d2da28d9ccfe // indirect v0.0.0-20220120001248-ee7290d23504 // indirect v0.0.0-20220602074514-4956b0afb3d2 // indirect v0.0.0-20211210172815-726fda9656d6 // indirect v0.0.0-20221017161538-93cebf72946b // indirect v0.0.0-20230619120952-35bccb6164b8 // indirect v0.0.0-20230616162802-9c17dd34aa4a // indirect v5.1.0 // indirect v1.17.2 // indirect v0.0.0-20151104160322-e2ba15ffa76e // indirect v1.0.0 // indirect v0.0.0-20221011165216-be6e8873101c // indirect v0.0.0-20220730225603-2ab79fcdd4ef // indirect v1.8.4 // indirect v1.2.0 // indirect v1.5.5 // indirect v0.11.0 // indirect v0.0.0-20230531173138-3c911d8e3eda // indirect v0.14.0 // indirect v0.11.0 // indirect v0.12.0 // indirect v3.0.1 // indirect v0.0.0-20210725211120-f030747120f2 // indirect

Any ideas? All help much appreciated!

Hi @Ethan_Leonard, welcome to the forum.

I changed Call2 to get a response from a test HTTP server, then I ran the code using CGO_ENABLED=1 go run . .

I get a compiler warning (macOS-specific as it seems), but no other errors.

ld: warning: ignoring duplicate libraries: '-lobjc'

The main window opens and shows the test server’s response.

Screenshot 2023-10-30 at 09.45.19

It seems there is nothing wrong with the code. My go.mod is identical to yours (except for the module name).

I assume this is a problem with Fyne on Windows (see, e.g., these issues). (Having no Windows machine, I cannot dig deeper at this point.)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.