repr:Python的repr()for Go

时间:2021-05-08 06:14:39
【文件属性】:
文件名称:repr:Python的repr()for Go
文件大小:8KB
文件格式:ZIP
更新时间:2021-05-08 06:14:39
Go Python的repr()for Go 这个包试图以几乎可以直接在Go源代码中使用的形式表示Go值。 不幸的是,某些值(例如指向基本类型的指针)不能直接在Go中表示。 这些值将表示为& 。 例如。 &23 例子 type test struct { S string I int A [] int } func main () { repr . Print ( & test { S : "String" , I : 123 , A : [] int { 1 , 2 , 3 }, }) } 产出 &main.test{S: "String", I: 123, A: []int{1, 2, 3}} 为什么是repr而不是 ? pp是专为将彩色输出打印到控制台而设计的,(似乎吗?)无法禁用它。 如果您不希望使用彩色输出(例如,用于差
【文件预览】:
repr-master
----.circleci()
--------config.yml(637B)
----COPYING(1KB)
----README.md(2KB)
----repr.go(9KB)
----.github()
--------FUNDING.yml(21B)
----repr_test.go(5KB)
----go.mod(43B)
----go.sum(0B)

网友评论