-1

I have this:

package utils_test

import (
    "huru/utils"
    "testing"
)

func TestSetFields(t *testing.T) {

    t.Log("dest.Foo")

    src := struct{}{}
    dest := struct{}{}
    utils.SetFields(&src, &dest)

    t.Log("dest.Foo", dest)
}

and I run this command:

go test -run TestSetFields ./src/huru/utils/utils_test.go

all I see this output:

ok      command-line-arguments  (cached)

I can't get any logging output, I tried log.Println and t.Log, to no avail.

1 Answers1

3

Hope this helps:

go test -v -run TestSetFields ./src/huru/utils/utils_test.go

Here is the answer How do you print in a Go test using the "testing" package?

Andrii Soluk
  • 520
  • 1
  • 6
  • 14
  • thanks so you have to point to the full file path? I was hoping you could just run `go test -v -run TestSetFields` from the base of your project, oh well. –  Oct 29 '18 at 03:37
  • perhaps mention the `-test.v` flag? –  Oct 29 '18 at 03:38