Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Working with code in a repo subdir? #1470

Closed
adam-p opened this issue Jan 18, 2018 · 4 comments
Closed

Working with code in a repo subdir? #1470

adam-p opened this issue Jan 18, 2018 · 4 comments

Comments

@adam-p
Copy link

adam-p commented Jan 18, 2018

I have an app (not distributable package) project that lives in a subdirectory. Like: ${workspaceFolder}/server, and under that is main.go and various package directories.

The Go extension doesn't seem to like this arrangement. In the "Problems" pane there's a persistent "can't load package: package github.com/adam-p/example: no Go files in [path here]". That message is certainly true -- the Go files start in the "server" subdirectory, not top-level.

When I run "Go: Build Workspace" I get the same error, followed by successes as the subdirectories build (with no executable being produced).

I've looked through the vscode-go settings and I don't see a way to tell it where to look for the code. I've looked through the Go build flags and don't see anything that seems likely to help. I've created a VSCode build task that specifies main.go and works, but it doesn't make the extension build errors go away (of course).

Any pointers would be appreciated.

@ramya-rao-a
Copy link
Contributor

If you can replicate the issue in a small code sample and share the code and the folder structure, I can attempt to figure out what is going on

@adam-p
Copy link
Author

adam-p commented Jan 18, 2018

This should do it: https://github.com/adam-p/vscode-go-subdir

Build the workspace and check the Problems tab in the lower pane.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jan 20, 2018

That was simple enough :)
Thanks for reporting this @adam-p
I have pushed a fix which should be out in the next update to the Go extension which should be in a week or so

@ramya-rao-a
Copy link
Contributor

Just released an update (0.6.74) that has the fix for this issue. Thanks for your patience @adam-p!

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants