summaryrefslogtreecommitdiff
path: root/src/pkg/text/tabwriter/example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/text/tabwriter/example_test.go')
-rw-r--r--src/pkg/text/tabwriter/example_test.go38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/pkg/text/tabwriter/example_test.go b/src/pkg/text/tabwriter/example_test.go
deleted file mode 100644
index 20443cb1f..000000000
--- a/src/pkg/text/tabwriter/example_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2012 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tabwriter_test
-
-import (
- "fmt"
- "os"
- "text/tabwriter"
-)
-
-func ExampleWriter_Init() {
- w := new(tabwriter.Writer)
-
- // Format in tab-separated columns with a tab stop of 8.
- w.Init(os.Stdout, 0, 8, 0, '\t', 0)
- fmt.Fprintln(w, "a\tb\tc\td\t.")
- fmt.Fprintln(w, "123\t12345\t1234567\t123456789\t.")
- fmt.Fprintln(w)
- w.Flush()
-
- // Format right-aligned in space-separated columns of minimal width 5
- // and at least one blank of padding (so wider column entries do not
- // touch each other).
- w.Init(os.Stdout, 5, 0, 1, ' ', tabwriter.AlignRight)
- fmt.Fprintln(w, "a\tb\tc\td\t.")
- fmt.Fprintln(w, "123\t12345\t1234567\t123456789\t.")
- fmt.Fprintln(w)
- w.Flush()
-
- // output:
- // a b c d .
- // 123 12345 1234567 123456789 .
- //
- // a b c d.
- // 123 12345 1234567 123456789.
-}