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

GoCoverage fails with cannot find package '-coverprofile' #899

Closed
gataky opened this issue Jun 11, 2016 · 4 comments
Closed

GoCoverage fails with cannot find package '-coverprofile' #899

gataky opened this issue Jun 11, 2016 · 4 comments

Comments

@gataky
Copy link

gataky commented Jun 11, 2016

Actual behavior

Executing :GoCoverage causes the following error:

vim-go: FAILEDvim-go: can't load package: package '-coverprofile': cannot find package "'-coverprofile'" in any of: 

Expected behavior

Coverage report to overlay buffer

Steps to reproduce:

Minimal main.go

package main

import "fmt"

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

Minimal main_test.go

package main

import "testing"

func TestHandler(t *testing.T) {
    main()
}

:GoCoverage

Configuration

I can run coverage outside of vim just fine.

:GoTest works as expected

I know support for neovim is in beta but I poked around in the coverage.vim file and saw conditions for nvim so figured that it may be supported. That's about the extent of my vimscript debugging sadly.

  • vimrc you used to reproduce
call plug#begin('~/.config/nvim/plugged')
Plug 'failt/vim-go'
call plug#end()
  • vim version:
    neovim 0.1.4
  • vim-go version
    vim-go 1.7.1
  • go version
    go version go1.6.2 darwin/amd64
@gataky gataky changed the title GoCoverage GoCoverage fails with cannot find package '-coverprofile' Jun 11, 2016
@fatih
Copy link
Owner

fatih commented Jun 11, 2016

Hi @sir-wiggles

Just discovered this myself too in Neovim. If you run it in Vim you'll see there is no problem. Must be something that was introduced with the latest version. I'll take a look at this. Thanks.

@fatih
Copy link
Owner

fatih commented Jun 11, 2016

Alright it's broken due this line:

https://github.com/fatih/vim-go/pull/869/files#diff-a3998a862a20bc1665a15c84f401349fR200

Not sure how to fix it without pulling it out. We only need to escape the file after -coverprofile , but not the flag itself. Checking now.

fatih added a commit that referenced this issue Jun 11, 2016
Neovim didn't like escaping it. Just disable it.

Closes #899
@fatih
Copy link
Owner

fatih commented Jun 11, 2016

The fix in master. Thanks for the feedback.

@gataky
Copy link
Author

gataky commented Jun 11, 2016

Wow you're fast! I was taking my first dive into vim scripting with this and was WAY off. 😛

Thanks for the amazing 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

2 participants