package
module
Version:
v0.0.2
Opens a new window with list of versions in this module.
Published: May 9, 2020
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
bmfmt Golang [b]eautify [m]ap display [fmt] for Humans
Install
# Stable version
go get -u -v gopkg.in/c0de8/bmfmt.v0
# Latest version
go get -u -v github.com/c0de8/bmfmt
Usage
API Documentation
Examples
package main
import (
"fmt"
bmfmt "github.com/c0de8/bmfmt"
)
func main() {
example()
}
func example() {
m := map[string][]string{
"some-key": { "response" },
"Another-Hash-Key": { "first value", "second value" },
}
fmt.Println(m) // fmt the default formatting
/*
map[some-key:[response] Another-Hash-Key:[first value second value]]
*/
err := bmfmt.Beautify(m) // significant more friendly formatting
if err != nil {
fmt.Println("ERROR (bmfmt.Beautify): " + err.Error())
}
/*
[ "some-key" string( 8) ]: "response" string( 8)
[ "Another-Hash-Key" string( 16) ]: "first value", "second value" string( 23)
*/
}
License
bmfmt is licensed under the MIT License. See LICENSE for the full license text.
Documentation
¶
func Beautify(a interface{}) error
Beautify prints a given map (any key and value type) to a better readable format
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.