goutil: github.com/gookit/goutil/jsonutil Index | Files

package jsonutil

import "github.com/gookit/goutil/jsonutil"

Index

Package Files

jsonutil.go

func Decode Uses

func Decode(json []byte, v interface{}) error

Decode decode json bytes to data. use it instead of json.Unmarshal

func Encode Uses

func Encode(v interface{}) ([]byte, error)

Encode encode data to json bytes. use it instead of json.Marshal

func Pretty Uses

func Pretty(v interface{}) (string, error)

Pretty get pretty JSON string

func ReadFile Uses

func ReadFile(filePath string, v interface{}) error

ReadFile Read JSON file data

func StripComments Uses

func StripComments(src string) string

StripComments strip comments for a JSON string

func WriteFile Uses

func WriteFile(filePath string, data interface{}) error

WriteFile write data to JSON file

Package jsonutil imports 8 packages (graph) and is imported by 5 packages. Updated 2020-01-12. Refresh now. Tools for package owners.