Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/C0DE8/bmfmt
Golang [b]eautify [m]ap display [fmt] for Humans
https://github.com/C0DE8/bmfmt
beautifier fmt for-humans formater formatter go go-lang go-library golang humans prettifier pretty
Last synced: 28 days ago
JSON representation
Golang [b]eautify [m]ap display [fmt] for Humans
- Host: GitHub
- URL: https://github.com/C0DE8/bmfmt
- Owner: C0DE8
- License: mit
- Created: 2020-05-09T09:52:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-05-20T06:08:11.000Z (over 4 years ago)
- Last Synced: 2024-08-03T23:27:22.293Z (4 months ago)
- Topics: beautifier, fmt, for-humans, formater, formatter, go, go-lang, go-library, golang, humans, prettifier, pretty
- Language: Go
- Size: 32.2 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - bmfmt
README
# bmfmt Golang [b]eautify [m]ap display [fmt] for Humans
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/c0de8/bmfmt/graphs/commit-activity)
[![Github all releases](https://img.shields.io/github/downloads/c0de8/bmfmt/total.svg)](https://GitHub.com/c0de8/bmfmt/releases/)
[![Build Status](https://travis-ci.com/C0DE8/bmfmt.svg?branch=master)](https://travis-ci.com/C0DE8/bmfmt)## Install
``` shell
# stable version
go get -u -v gopkg.in/c0de8/bmfmt.v0# latest version (may be unstable)
go get -u -v github.com/c0de8/bmfmt
```## Supported Structures
- map[string]string
- map[string][]stringMore structures are in implementation.
## Usage
[API Documentation](https://pkg.go.dev/github.com/c0de8/bmfmt?tab=doc)
[Examples](https://github.com/c0de8/bmfmt/blob/master/examples/main.go)
``` golang
package mainimport (
"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](https://github.com/c0de8/bmfmt/blob/master/LICENSE) for the full license text.