title: How do you print in a Go test using the "testing" package?
body: <p>I'm running a test in Go with a statement to print something (i.e. for debugging of tests) but it's not printing anything.</p>
  
  <pre><code>func TestPrintSomething(t *testing.T) {
      fmt.Println("Say hi")
  }
  </code></pre>
  
  <p>When I run go test on this file, this is the output:</p>
  
  <pre><code>ok      command-line-arguments  0.004s
  </code></pre>
  
  <p>The only way to really get it to print, as far as I know, is to print it via t.Error(), like so: </p>
  
  <pre><code>func TestPrintSomethingAgain(t *testing.T) {
      t.Error("Say hi")
  }
  </code></pre>
  
  <p>Which outputs this:</p>
  
  <pre><code>Say hi
  --- FAIL: TestPrintSomethingAgain (0.00 seconds)
      foo_test.go:35: Say hi
  FAIL
  FAIL    command-line-arguments  0.003s
  gom:  exit status 1
  </code></pre>
  
  <p>I've Googled and looked through the manual but didn't find anything.</p>