Skip to content

yyle88/neatjson

Repository files navigation

GitHub Workflow Status (branch) GoDoc Coverage Status Supported Go Versions GitHub Release Go Report Card

neatjson

neatjson make it neat to use "encoding/json" in golang.

CHINESE README

中文说明

Installation

go get github.com/yyle88/neatjson

Features

  • Convert Go structures to indented JSON strings.
  • Format JSON data from raw strings, byte arrays.

Usage

Here's an example of how to format a Go data structure into a indented JSON string:

package main

import (
	"fmt"
	"github.com/yyle88/neatjson/neatjsons"
)

func main() {
	arg := map[string]any{"a": "abc", "n": 123}
	res := neatjsons.S(arg)

	fmt.Println(res)
}

Output:

{
	"a": "abc",
	"n": 123
}

License

neatjson is open-source and released under the MIT License. See the LICENSE file for more information.


Support

Welcome to contribute to this project by submitting pull requests or reporting issues.

If you find this package helpful, give it a star on GitHub!

Thank you for your support!

Happy Coding with neatjson! 🎉

Give me stars. Thank you!!!

See stars

see stars