Documentation
¶
Index ¶
- func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error)
- func Fprintln(w io.Writer, value interface{}, sep string) (n int, err error)
- func Printf(format string, a ...interface{}) (n int, err error)
- func Println(value interface{}, sep string) (n int, err error)
- type Formatter
- type SimpleFormatter
- type Writer
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fprintln ¶
Example ¶
Fprintln + tabwriter
package main
import (
"os"
"text/tabwriter"
"github.com/gnue/fieldfmt"
)
func main() {
var s = struct {
Id int
From string `field:"from,omitempty"`
To string `field:""`
}{1, "foo", "bar"}
w := tabwriter.NewWriter(os.Stdout, 0, 4, 1, ' ', 0)
fieldfmt.Fprintln(w, &s, ":\t")
w.Flush()
}
Output: Id: 1 from: foo To: bar
Types ¶
type SimpleFormatter ¶
type SimpleFormatter string
func (SimpleFormatter) Format ¶
func (f SimpleFormatter) Format(k, v interface{}) string
Click to show internal directories.
Click to hide internal directories.