title: How do I get colors to work with golang tabwriter?
body: <p>I am using the tabwriter and I cannot get it to work with colors.  I am using the "github.com/fatih/color" package.</p>
  
  <p>Basically the problem is that I need to call tabwriter's <code>w.Flush()</code> in order to get the colors to render... I cannot switch colors if I have not called a flush.</p>
  
  <p>Calling Flush in turn screws with the tabwriter formatting.</p>
  
  <p>Any ideas on how to combine the two?</p>
  
  <pre><code>    package main
  
      import "fmt"
      import "text/tabwriter"
      import "os"
      import "github.com/fatih/color"
  
      func main() {
          w := new(tabwriter.Writer)
          w.Init(os.Stderr, 0, 8, 0, '\t', 0)
          color.Set(color.FgGreen)
          fmt.Fprintln(w, "ID\tNAME\tSIZE\tFIELD1\tSTATUS\tSTATE")
          // ------&gt; Calling w.Flush() here cases problems.
          color.Set(color.FgYellow)
          fmt.Fprintln(w, "8617833164795356724\tfoo1\t1.1 Gb\t3\tsome_status\tsome_state")
          fmt.Fprintln(w) 
          w.Flush()
      }
  </code></pre>