go环境搭建

GORM 指南:https://gorm.io/zh_CN/docs/

go学习一本通:https://www.go-edu.cn

 

GOPATH   D:\wwwroot\go

GOROOT  D:\Program Files\Go\bin

Path 添加 

%USERPROFILE%\go\bin  

%GOPATH%\bin  

%GOROOT%\bin 

D:\Program Files\Go\bin


GO语言运行环境下载、安装、配置图文教程:http://www.zzvips.com/article/63076.html

菜鸟教程:https://www.runoob.com/go/go-tutorial.html


编辑器:https://tech.souyunku.com/?p=16220

从0开始Go语言,用Golang搭建网站:https://studygolang.com/articles/20362?fr=sidebar


cd Go_WorkSpace

go run test.go


https://jingyan.baidu.com/article/0eb457e5f5c06603f1a90589.html


打印
db.debug()
db.lastsql()


where

db.Where("delete_time IS NULL")
db = db.Where("dept_id in (?)", data.DeptIds)
db = db.Where("title like ?", "%"+data.Title+"%")
db = db.Where("notice_type = ?", data.NoticeType)

Print()函数不换行,Println()换行输出

make与new的区别与深入理解:
https://blog.csdn.net/weixin_38371073/article/details/121435416
func make(t Type, size ...IntegerType) Type //多个参数,返回值位类型
func new(Type) *Type //一个参数,返回值位参数指针
make: 只能用于分配并初始化 slice、map和chan三种类型的对象,结果与参数类型相同,取决于具体类型。
new: 用于分配内存,返回值位指向类型的指针,内存里值为零

make用法和参数用法:
golang分配内存有一个make函数,该函数第一个数类型,第二个参数的分配的空间,第三个
参数时预留分配空间,前两个参数很好理解,但对第三个参数不是很理解,

 

posted @ 2022-12-27 16:35  minch  阅读(40)  评论(0)    收藏  举报