FAQ
My function use "log" package to output some logs.
I've written a myfunc_test.go.
And I wish don't printout the log output if -test.v is not turn on.
Is that possible?

Or, just disable the "log" output when I'm running testing to simplified
the test output.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Dlin at May 8, 2013 at 11:40 am
    Am I right? just put this line in the TestMyFunc()

    log.SetOutput(ioutil.Discard)
    On Wednesday, May 8, 2013 7:35:03 PM UTC+8, dlin wrote:

    My function use "log" package to output some logs.
    I've written a myfunc_test.go.
    And I wish don't printout the log output if -test.v is not turn on.
    Is that possible?

    Or, just disable the "log" output when I'm running testing to simplified
    the test output.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Aaron France at May 8, 2013 at 11:46 am
    That will work.

    On Wed, May 8, 2013 at 1:39 PM, dlin wrote:

    Am I right? just put this line in the TestMyFunc()

    log.SetOutput(ioutil.Discard)

    On Wednesday, May 8, 2013 7:35:03 PM UTC+8, dlin wrote:

    My function use "log" package to output some logs.
    I've written a myfunc_test.go.
    And I wish don't printout the log output if -test.v is not turn on.
    Is that possible?

    Or, just disable the "log" output when I'm running testing to simplified
    the test output.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 8, '13 at 11:35a
activeMay 8, '13 at 11:46a
posts3
users2
websitegolang.org

2 users in discussion

Dlin: 2 posts Aaron France: 1 post

People

Translate

site design / logo © 2022 Grokbase