O'Reilly logo

Go Standard Library Cookbook by Radomir Sohlich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

The NewWriter function call creates the Writer filter with configured parameters. All data written by this Writer is formatted according to the parameters. os.Stdout is used here for demonstration purposes.

The text/tabwriter package also provides a few more configuration options, such as the flag parameter.  The most useful is tabwriter.AlignRight, which configures the writer to align the content to the right in each column.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required