摘要: 特点: 定义 struct声明: type 标识符 struct{ field1 type field2 type } example: type Student struct{ Name string Age int Score int } struct中字段访问 struct定义的三种形式 va 阅读全文
posted @ 2018-07-23 09:56 hongpeng0209 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 字符串 字符串是不可变字节序列 字符串默认值" ",不是nil 使用"`"定义不做转义的原始字符串,支持跨行 支持"!=,<,>,=="操作符 允许索引号访问字节数组,但是不能获取元素地址 for遍历字符串时,分byte rune两种方式 rune 字符串拼接 加法操作拼接字符串时,每次都需要重新分 阅读全文
posted @ 2018-07-23 09:56 hongpeng0209 阅读(124) 评论(0) 推荐(0) 编辑