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

go.buildTags only works properly with a single tag #1355

Closed
mfpierre opened this issue Nov 20, 2017 · 6 comments
Closed

go.buildTags only works properly with a single tag #1355

mfpierre opened this issue Nov 20, 2017 · 6 comments

Comments

@mfpierre
Copy link

Issue

I've been experiencing issues with the go.buildTags setting. It seems to work fine only when you have a single tag.

When using multiple tags (space-separated) the tools are not working properly anymore on tagged files (as if no tags were applied).

How to reproduce

// +build randomtag

package main

import (
	"fmt"
)

func main() {
	fmt.Println("hello")
	foobar
}

with "go.buildTags": "randomtag" reporting the error correctly undefined: foobar

with "go.buildTags": "randomtag othertag" -> build constraints exclude all Go files

ramya-rao-a added a commit that referenced this issue Nov 21, 2017
ramya-rao-a added a commit that referenced this issue Nov 21, 2017
ramya-rao-a added a commit that referenced this issue Nov 22, 2017
* Support multiple build tags #1355

* fix tests

* verbose test

* fix failing test
@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Nov 22, 2017

@mfpierre I have pushed a fix for this, can you help in testing it out? All you have to do is

Do try out features like rename, find references etc and see if all the language features work with multiple build tags. The go to definition should work when using gogetdoc in the go.docsTool setting

And thanks for reporting this.

@mfpierre
Copy link
Author

@ramya-rao-a thanks for the fix, however I'm not able to install the provided extension

Error: end of central directory record signature not found
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules/yauzl/index.js:183:14
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules/yauzl/index.js:618:5
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules/fd-slicer/index.js:32:7
    at FSReqWrap.wrapper [as oncomplete] (fs.js:629:17)

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Nov 22, 2017

You must be on ubuntu where for some reason direct download doesnt work.
Can you clone this repo and then use the vsix file from the repo?

@mfpierre
Copy link
Author

mfpierre commented Nov 23, 2017

@ramya-rao-a I'm on OSX but the install from the cloned repo worked, from what I've tested so far seems to be fixed 👍

@ramya-rao-a
Copy link
Contributor

great, did you try other features like rename, find all references etc? The Go tools that back these features also take the build tags. Also give the new commands Go: Build Current Package, Go: Install Current Package a try. These are not released yet, but since you are using the code from master you can use them

@ramya-rao-a
Copy link
Contributor

The fix is out in the latest update to the Go extension (0.6.69)

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 23, 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