How can I see the fmt output in tested code when I run go test

1,024 views
Skip to first unread message

aXe

unread,
Mar 30, 2013, 3:38:25 AM3/30/13
to golan...@googlegroups.com
as subjected.

I run go test -v xxxx. I just saw the testing.T.Log, couldn't see fmt
output.

--
//bow
aXe

Dave Cheney

unread,
Mar 30, 2013, 3:41:15 AM3/30/13
to aXe, golan...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


aXe

unread,
Mar 30, 2013, 3:53:28 AM3/30/13
to golan...@googlegroups.com
No. That's not my question.

E.G.,

//main.go
import "fmt"

func MyPrint() {
    fmt.Println("hello, it's myprint")
}


//main_test.go
import "testing"
func Test_MyPrint(t *testing.T) {
    t.Log("Hi! it's my testing")
    MyPrint()
}



Then I run go test -v .
I can see "Hi! it's my testing". But I can't see "hello, it's myprint"
Actually when I run the example in this mail. it works well and I can see fmt output. But in my another verbose code it failed... I don't know how to identify the problem. Please help.
thx.
//bow
aXe

axe

unread,
Mar 30, 2013, 7:19:00 AM3/30/13
to golan...@googlegroups.com
sorry to disturb all. please ignore all the question in this thread. I have found the root of the problem. It's a stupid mistake in code of mine that fmt part never run...
:(

在 2013年3月30日星期六UTC+8下午3时53分28秒,axe写道:
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages