Build constraints exclude all the Go files in ...

已回答

Mechine: mac pro m1 

OS version 13.0.1 (22A400)

IDE: Goland version  2023.03.03

The error message shows “Build constraints exclude all the Go files in”, but this module is correctly imported and loaded.

Go version 1.13.15

And this error is not happen on Goland version 2022.2.6

0

Is it reproducible in a new project?

Does File | Invalidate Caches... help?

0

I tried File | Invalidate Caches..., it didn't work.

Below is the comparison between Goland 2023.3.3(left) and Goland 2023.2.6(right, and it works ok).
They all use the same Go SDK , version 1.13.15

 
0

Did you check if it's reproducible in a new project?

Any chance you could share that project with us, so we can take a closer look?

0

I have tried several projects, but it can be reproduced in only some private projects.(The picture upper showing the error is in some private project that can not be shared. )

And I cannot reproduce it in projects which clone from the github .

After some tests, I guess the error may be caused by the IDE "loading the module",  sometimes modules defined in go.mod file cannot be seen in the left project panel.

Any other way to figure out what happens to the module loading process?

 

 

 

0

Please report it to https://youtrack.jetbrains.com/issues/GO and attach your idea.log file (Help | Show Log in...)
The QA team will take a look.
The forum doesn't allow attachments, unfortunately.

0

Facing same issue. It is giving error for all project in my case for certain imports. 

0

Please try out the 2023.2 EAP version of GoLand (https://www.jetbrains.com/go/nextversion/). It should be resolved there.

1

Hi,

Same problem here. I'm already using the version 2023.1.2. Since one or two updates, I have a lot of issues about imports. What is the release date of the next update ?

Thank you.

PS: I tested 2023.2 EAP, still have the issue.

0

Found a workaround for the issue: thanks to the comments in the issue https://youtrack.jetbrains.com/issue/GO-14545/Build-constraints-exclude-all-the-Go-files-in-?_ga=2.52269417.1910323218.1686152833-1274279645.1686152833 , it seems that deleting the .idea folder and then re-import the project fixes the issue.

Maybe an update of the project folder with a version of Goland that breaks something or changes a configuration. Hope it helps someone.

1

Thanks Boris Lenzinger, it work.

Delete the .idea folder and then re-open the project fixes the issue.

1

i have the same issue, deleting the .idea folder didnt worked any other solution?

GoLand 2023.2.5
Build #GO-232.10227.11, built on November 14, 2023
Licensed to Dimitrios Toskas
Subscription is active until June 30, 2024.
Runtime version: 17.0.9+7-b1000.46 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.5.0-13-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 24
Registry:
   suggest.all.run.configurations.from.context=true
   ide.completion.variant.limit=500
   ide.experimental.ui=true


Current Desktop: KDE

0

Hi Ditoskas, please share a screenshot of this notification. Do you have correct build tags in Settings | Go | Build Tags?

0

@... please find below the information

0

Hello Ditoskas,

It means that GoLand cannot find any Go files in convert/proto directory which is true (you cannot import proto definitions, you should compile protobuf to Go code).

Please see: https://protobuf.dev/getting-started/gotutorial/

0

请先登录再写评论。