jsonutils

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileToJsonMap

func FileToJsonMap(path string) (result map[string]interface{})

读取标准json格式,返回map

func FileToJsonObject

func FileToJsonObject(path string, object interface{})

读取标准josn格式,返回 object 传入: &object

func GetValueWithKeyFromFile

func GetValueWithKeyFromFile(path string, key string) string

根据key从json文件中读取value

func JsonSliceToLineFile

func JsonSliceToLineFile(path string, datas interface{}) bool

将结构体切片逐行写入到文件 datas: [{a:"1"},{b:"2"}] 文件中: {a:"1"} {b:"2"}

func JsonToFile

func JsonToFile(path string, data interface{}) bool

将json写入到文件,标准json格式

func JsonToFileFormat

func JsonToFileFormat(path string, data interface{}) bool

将json格式化后写入到文件,标准json格式

func JsonToLineFile

func JsonToLineFile(path string, data interface{}) bool

将json追加到文件中的最后一行

Types

This section is empty.

Jump to

Keyboard shortcuts

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