I have added multiple root packages in Visual Studio Code and defined the dependencies and packages properly. When I build my code I am not getting any compiler errors and I am able to run the application. There is no issue in compiling and running the application. But Visual studio code is giving me the following error in all the imports in the go file and also in the package declaration of go.mod files. I tried many suggestions from different sites but the issue is still there. Could you please help me resolve this issue?
Error on import statements:
could not import pdi.com/optctrl/controllers/states (no required module provides package "pdi.com/optctrl/controllers/states"(workspace configuration error: err: exit status 1: stderr: go: updates to go.mod needed, disabled by -mod=readonly; to update it: go mod tidy
Error on package declaration of go.mod:
err: exit status 1: stderr: go: updates to go.mod needed, disabled by -mod=readonly; to update it: go mod tidy
Multiple packages added to VSC
[![Multiple packages added to VSC][1]][1]