![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
go
小画家~
这个作者很懒,什么都没留下…
展开
-
GO语言-结构体版学生管理系统
package main import "fmt" //学生管理系统//有一个物件:// 1.它保存了一些数据 --> 结构体的字段// 2.他有4个功能 --> 结构体的方法type student struct { id int64 name string} //造一个学生的管理者type studentMgr struct { allStudent map[int64]student} //查看学生func (s studentMgr) .转载 2021-12-31 18:15:59 · 266 阅读 · 0 评论 -
GO语言-函数版学生管理系统
GO的结构体,方法,Map,fmt等基础语法package main import ( "fmt" "os") /*函数版学生管理系统写一个系统能够查看\新增\删除学生*/type student struct { id int64 name string} //声明student的构造函数func newStudent(id int64, name string) *student { return &student{ id: id, na.转载 2021-12-31 17:50:31 · 197 阅读 · 0 评论 -
go module 2020-10-11
fgfgfgset GO111MODULE=on go mod 执行:非$GOPATH目录下的go mod项目$ go mod init test go get github.com/jinzhu/gorm // 直接下载某个包 https://www.cnblogs.com/linguoguo/p/10813037.htmlhttps://www.liwenzhou.com/posts/Go/go_dependency/ 常用的go mod命令原创 2020-10-11 21:29:51 · 116 阅读 · 0 评论 -
go 语法基础
package mainimport "fmt"import "math"func foo()(string ,int){ return "Hello",1000}func main() { var a5,b6,d float32 a5 = 3 b6 = 2 d = a5/b6 fmt.Println(a5,b6,d) ...原创 2019-07-12 18:56:14 · 115 阅读 · 0 评论 -
go 字符串如何进行修改
str := "hello world"c := []rune(str) // 转换 s 为 rune 数组//fmt.Printf("%c", c[0])//c[0] = c//fmt.Printf("%T", c) // 查看类型c[0] = 'N' // 修改数组的第一个元素;只能是单引号 间个字符str2 := string(c) ...原创 2019-08-06 18:43:22 · 2201 阅读 · 0 评论 -
slice byte 字节数 属性的应用
data:=[4]byte{1,2,3,4}想转成字符串显示,试了使用str:=string(data)fmt.Print(str)但是输出为空白,不知道应该怎样转换?func main() { data := [4]byte{0x31, 0x32, 0x33, 0x34} str := string(data[:]) fmt.Println(str...原创 2019-08-13 17:19:30 · 398 阅读 · 0 评论 -
array、slices 和 map
Go 关键字able 1.2. Go 中的关键字break default func interface selectcase defer go map structchan else goto package switchconst fallthrough if ...原创 2019-08-15 19:11:58 · 120 阅读 · 0 评论