Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Guru navigation should support build tags #603

Closed
6 of 7 tasks
krasi-georgiev opened this issue Mar 19, 2017 · 5 comments
Closed
6 of 7 tasks

Guru navigation should support build tags #603

krasi-georgiev opened this issue Mar 19, 2017 · 5 comments

Comments

@krasi-georgiev
Copy link

krasi-georgiev commented Mar 19, 2017

Atom 1.15.0

this happens only for some packages.
A quick google search show that it has something to do with the
//+build tags

$ /usr/local/Cellar/go/1.8/libexec/bin/go version
go version go1.8 darwin/amd64

$ /usr/local/Cellar/go/1.8/libexec/bin/go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/krasimir"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PHP DebugPHP ConsoleSettings
go-plus6 deprecations

  • Have you tried launching atom . from the terminal in your project's directory?
  • Have you verified the output from go env is correct? If it is, please include the output in this issue.
  • Have you updated Atom to the latest version?
  • Have you tried using Atom Beta, which can be run side-by-side with Atom Stable? Is the behavior the same, or different?
    No, Don't think it is relevant.
  • Have you updated your Atom packages to the latest versions?
  • Have you read the FAQ?
  • Have you searched the issues to see if others are experiencing the same issue?

Output from atom -v && apm -v

Atom : 1.15.0
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0
apm 1.15.3
npm 3.10.5
node 4.4.5 x64
python 2.7.10
git 2.10.1

Output From go env

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/krasimir/projects/vipconsult/golang"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

Steps to Reproduce

https://screencast.com/t/LC2xKqlc

Expected Behavior

to navigate to the correct package

Actual Behavior

error

@krasi-georgiev
Copy link
Author

krasi-georgiev commented Mar 20, 2017

I figured it
I was trying to navigate a code that was intended for linux os target so just need to set the GOOS env to linux

export GOOS=linux

for OSX this needs to be set in ~/.bash_profile

@krasi-georgiev
Copy link
Author

now I hit another issue when trying to compile a darwin package I need change the $GOOS every time

would it make sense to allow setting custom env in go-plus instead of the default ~/.bash_profile ?

@zmb3
Copy link
Collaborator

zmb3 commented Mar 22, 2017 via email

@krasi-georgiev
Copy link
Author

my issue is code navigation CTRL+click to go to function definition.

@zmb3
Copy link
Collaborator

zmb3 commented Mar 26, 2017

Right, but setting GOOS affects everything. For example:

  • Go-Plus will be cross compiling your builds, which is often slower and may pollute your GOPATH
  • Tests won't run since you would be compiling for another OS

The real issue here is that we need to pass -tags to the guru tool. Right now there's no way to configure this, but we've started work on project-based config (#597) that would allow you to specify build tags. I've updated the title of this issue to clarify.

@zmb3 zmb3 changed the title Code navigation not working for some packages with guru Guru navigation should support build tags Mar 26, 2017
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