lab003

command
v0.0.0-...-f10d331 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 6 Imported by: 0

README

json包中的NewDecoder和NewEncoder

这个方式读取和marshal的读取方式的区别是,这个是读取一个输入流上的内容然后去解析。

运行结果

Imgur

NOTICE

  • {"Depth":0,"Ctx":{"page":1,"a":"b"}},ctx要是直接unmarshal到map[string]interface{}的话,page值会是float64的,因为json包里面的规则就是float64对应json的number,可以看参考资料2里面

参考资料

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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