摘要: 在不使用omitempty时,使用json包来对json数据进行处理 package main import ( "encoding/json" "fmt" ) type Stu struct { Name string `json:"name"` Age int Class *Class `jso 阅读全文
posted @ 2020-09-18 01:34 LeeJuly 阅读(2301) 评论(0) 推荐(0) 编辑
摘要: 1.Go语言string最底层是byte数组 具体由一个结构体包装而成,其中包括了指向字节数组的指针和字节数组的长度 type StringHeader struct { Data uintptr Len int } 底层如何将string转换为[]byte func str2bytes(s str 阅读全文
posted @ 2020-09-18 01:31 LeeJuly 阅读(315) 评论(0) 推荐(0) 编辑