Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Goimports not working with vendored packages (only through vim-go, working with cmd in terminal) #734

Closed
relappi opened this issue Feb 21, 2016 · 4 comments

Comments

@relappi
Copy link

relappi commented Feb 21, 2016

On go 1.6, Reproduction steps...

Project structure

test.go
vendor/
  github.com/
    chzyer/
      logex/
        ...

test.go

package main

func main() {
    logex.Println("hello")
}
  • Note: go get github.com/chzyer/logex was never run
  • Running :GoImports (or saving with let g:go_fmt_command = "goimports") does nothing
  • In a terminal running goimports test.go yields...
package main

import "github.com/chzyer/logex"

func main() {
        logex.Println("hello")
}
@mhamrle
Copy link
Contributor

mhamrle commented Feb 23, 2016

I had the same problem, #735 fixed my problem.

@fatih
Copy link
Owner

fatih commented Feb 24, 2016

This is fixed with @mhamrle work #735. Please open an issue if the problem still insist. Thanks!

@fatih fatih closed this as completed Feb 24, 2016
@smonv
Copy link

smonv commented Jun 8, 2016

I still have this issue
I tried update latest goimports and vim-go but still have issue
NVIM 0.1.4
go version go1.6.2 linux/amd64

Project structure

main.go
vendor/github.com/nlopes/slack/...

main.go

package main

func main() {
    api := slack.New("")
}

If I run goimports -srcdir . main.go, it import like normal:

package main

import "github.com/nlopes/slack"

func main() {
        api := slack.New("")
}

@ricardoseriani
Copy link

I have this problem too (and even if I run goimports without the -srcdir . it will work)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants