samedi 27 octobre 2018

Logging in Golang test case

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.

Aucun commentaire:

Enregistrer un commentaire