
go
xdreamman
这个作者很懒,什么都没留下…
展开
-
golang 面试题和答案
题目来源:给以后的同学攒点golang的面经 - Go语言中文网 - Golang中文社区只要活着,就不算是悲剧。我们尚在途中,今后仍要继续。——《火花》戳 -> 校招-面经我主要用的还是go,虽然语言不是很重要,但投的基本上是跟go有关的公司,也有一些c++的公司,想往go发展的可以参考我的面经春招春招基本上是过完年回来开始,建议寒假开始复习然后回来就可以找实习了。我春招投的比较晚,后面投的公司不是很多,基本被刷简历,能面试的只有七牛云,然而第一次面试被各种吊打,春招后面去了深圳一家https://原创 2021-11-18 15:44:43 · 716 阅读 · 0 评论 -
golang 版本导致的编译bug
go version go1.12.9 linux/amd64package 的包名,需要和目录名一致原创 2021-08-03 14:44:04 · 343 阅读 · 0 评论 -
golang 删除数组中的某个元素(新建数组的方式)
func DeleteStringElement(list []string, ele string) []string { result := make([]string, 0) for _, v := range list { if v != ele { result = append(result, v) } } return result}原创 2021-07-30 09:38:55 · 2300 阅读 · 0 评论 -
gorm 注意点归纳 0值更新
1. scan 和 find软删除的scan 也可以查出来。一般不用scan原创 2020-11-10 09:40:21 · 1187 阅读 · 0 评论 -
Gorm Table 踩坑记录
Gorm Table1.table := w.Table("Student")status := table.Where("company_id = ?", form.CompanyId).RecordNotFound()以上代码永远是false,感觉是gorm的bug解决方案var count inttable.Where("company_id = ?", form.CompanyId).Count(&count)2.sql := "SELECT (CASE WH原创 2020-07-21 09:25:30 · 2848 阅读 · 1 评论 -
go 函数接受 * 指针变量的含义
如下所示 两个文件,打印的时候 传递指针变量 效果相同如果需要修改。只能传入指针才可以修改/*main.go*/package maintype Books struct { title string}func main() { var Book1 Books var Book2 Books Book1.title = "Go 语言" Book2.title = "Python 教程" Set(Book1) Set2(&Book2) PrintBook原创 2020-07-01 10:56:23 · 243 阅读 · 0 评论 -
go 不同方法浅析
目录1. 普通方法2. 实例方法1. 普通方法package maintype Name struct {}func call(name Name){ fmt.PrintLn(name)}func main() { var name Name call(name)}2. 实例方法package maintype Name struct {}func (name Name) call(i int) { fmt.Println(name).原创 2020-06-29 19:02:35 · 163 阅读 · 0 评论 -
go print
1.Print(无空格)// Print formats using the default formats for its operands and writes to standard output.// Spaces are added between operands when neither is a string.// It returns the number of bytes written and any write error encountered.2.Println(加原创 2020-06-29 10:50:21 · 651 阅读 · 0 评论