title: How can stdout be captured or suppressed for Go(lang) testing?
body: <p>How can stdout be captured or suppressed for Go testing?</p>
  
  <p>I am trying to teach myself go(lang) testing.  In the code below, myshow.LoadPath prints lots of information to stdout (which is a normal side effect).     It does however make for very noisy output when I run "go test"    Is there a way to suppress or capture stdout?   </p>
  
  <p>For comparison, I'm thinking about something like this from the python world. <a href="http://pytest.org/latest/capture.html#captures" rel="noreferrer">http://pytest.org/latest/capture.html#captures</a></p>
  
  <pre><code>package slideshow_test
  
  import (
      "os"
      "testing"
  
      "github.com/golliher/go-hpf/slideshow"
  )
  
  func setupTest() {
      myshow := slideshow.Slideshow{Name: "This is my show"}
      myshow.LoadPath("..")
  
  }
  
  func TestStub(t *testing.T) {
      if true == false {
          t.Fail()
      }
  }
  
  func TestMain(m *testing.M) {
      setupTest()
      os.Exit(m.Run())
  
  }
  </code></pre>