mardi 4 février 2020

go cover _test package in same directoy

Wondering if there is any way of telling go cover to use any _test file/package without -coverpkg. My architecture is as such:

|-my_package/
|--- file.go
|--- file_test.go

file.go is:

package my_package

func Foo() {
  // do something...
}

file_test.go

package my_package_test // note the '_test' package here


import (
    "testing"
)

func TestFunction(t *testing.T) {
    my_package.Foo()
}

Aucun commentaire:

Enregistrer un commentaire