【文件属性】:
文件名称:jsons:在Go中读取和写入.jsons文件
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-22 00:29:47
go json library Go
jsons
jsons是使用JSONS文件的Go库。
JSONS文件包含JSON对象,每行一个。 这种存储格式比存储对象数组更有效,因为在读取/写入对象时不需要将其加载到内存中。
安装
go get github.com/bfontaine/jsons
用法
读
func read () {
j := jsons . NewFileReader ( "foo.jsons" )
if err := j . Open (); err != nil {
log . Fatal ( err )
}
defer j . Close ()
for {
var m map [ string ] string
if err := j . Next ( & m ); err != nil {
【文件预览】:
jsons-master
----reader.go(476B)
----file_reader_test.go(960B)
----writer_test.go(387B)
----reader_test.go(857B)
----.travis.yml(145B)
----LICENSE(1KB)
----README.md(1KB)
----writer.go(459B)
----jsons.go(218B)
----file_reader.go(907B)
----file_writer.go(1014B)
----.gitignore(19B)
----file_writer_test.go(904B)