Skip to content

code coverage: highlighting not working on windows outside GOPATH/src #553

Closed
@benmj87

Description

@benmj87

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    go version go1.15 windows/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    1.48.0
    db40434f562994116e5b21c24015a2e40b2504e6
    x64
    
  • Check your installed extensions to get the version of the VS Code Go extension
    v0.16.1
  • Run go env to get the go development environment details
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Ben\AppData\Local\go-build
set GOENV=C:\Users\Ben\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Ben\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Ben\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Ben\AppData\Local\Temp\go-build063810058=/tmp/go-build -gno-record-gcc-switches

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

    "go.coverOnSave": true,
    "go.coverOnSingleTest": true,
    "go.coverOnSingleTestFile": true,
    "go.formatTool": "goimports"

Describe the bug

Upon updating vscode to the latest version, code coverage isn't shown in either the gutter or highlighting.

Steps to reproduce the behavior:

  1. With the following two files
package main

import "fmt"

func main() {
  fmt.Println(Sum(1, 2))
}

// Sum adds two numbers
func Sum(a int, b int) int {
  return a + b
}
package main

import "testing"

func TestSum(t *testing.T) {
  if Sum(1, 1) != 2 {
    t.Fail()
  }
}

Screenshots or recordings

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions