有谁知道如何获得变量的内存大小(int,string,[]struct等),并打印出来?可能吗?
int
string
[]struct
var i int = 1 //I want to get something like this: fmt.Println("Size of i is: %?", i) //Also, it would be nice if I could store the value into a string
memory-management runtime go
go ×1
memory-management ×1
runtime ×1