formatter

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package formatter provides function to format structured data into a variety of serialisation formats

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format added in v0.4.1

func Format(input interface{}, format string) (string, error)

Parse takes a Go interface{} and serialises it into the format specified.

Example
input := map[string]string{
	"Hello": "world!",
}

output, _ := Format(input, "json")

fmt.Println(output)
Output:

{
  "Hello": "world!"
}

func Names added in v0.4.1

func Names() []string

Names returns a sorted list of valid options for the "format" parameter of Format

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL