随笔分类 -  go

摘要:先说结论:go中所有的函数传参都为值传递 在 Go 语言中,切片(slice)是引用类型,因此在函数调用中传递切片时,实际上是传递了切片的引用(地址),而不是切片的副本。这意味着对传递的切片进行修改会影响原始切片的内容。 当将切片作为函数参数传递时,函数接收的是切片的引用。这使得函数可以访问和修改原 阅读全文
posted @ 2024-06-19 17:44 daniel456 阅读(466) 评论(0) 推荐(0)
摘要:转自https://mp.weixin.qq.com/s/X8c6ZIJdBFptYA9CRj6wnA 今天小土给大家带来一篇关于 Golang 项目中最简单的优化的文章。原文见 Golang: simple optimization notes[1] 我们这里简单聊一下优化本身,然后我们直接从实际 阅读全文
posted @ 2024-06-19 15:32 daniel456 阅读(41) 评论(0) 推荐(0)
摘要:https://www.jianshu.com/p/410d70050473 阅读全文
posted @ 2024-03-19 16:40 daniel456 阅读(39) 评论(0) 推荐(0)
摘要:https://mp.weixin.qq.com/s/rfbZ79TmZ61lx_JBnwDJMQ# or https://www.cnblogs.com/-wenli/p/12343300.html 阅读全文
posted @ 2023-09-13 21:49 daniel456 阅读(15) 评论(0) 推荐(0)
摘要:https://mp.weixin.qq.com/s/JC14dWffHub0nfPlPipsHQ 阅读全文
posted @ 2022-10-26 16:58 daniel456 阅读(11) 评论(0) 推荐(0)
摘要:一、项目目录下执行: go vet ./... 二、代码风格 go fmt ./... 会自动格式化目录下所有代码文件 三、静态检测 go build -race 阅读全文
posted @ 2022-10-21 14:31 daniel456 阅读(40) 评论(0) 推荐(0)
摘要:https://www.jianshu.com/p/5abb14c18c9c 阅读全文
posted @ 2022-10-17 22:36 daniel456 阅读(19) 评论(0) 推荐(0)
摘要:https://article.itxueyuan.com/ZooDow 阅读全文
posted @ 2022-10-11 11:59 daniel456 阅读(13) 评论(0) 推荐(0)
摘要:http://code.js-code.com/android/229010.html 阅读全文
posted @ 2022-10-10 16:47 daniel456 阅读(22) 评论(0) 推荐(0)
摘要:https://www.w3cschool.cn/go_internals/go_internals-kho3283t.html 阅读全文
posted @ 2022-09-29 22:21 daniel456 阅读(18) 评论(0) 推荐(0)
摘要:主要参考 https://studygolang.com/articles/35293 https://zhuanlan.zhihu.com/p/424624289 还有 http://github.com/fatih/structs struct结构解析 http://github.com/mit 阅读全文
posted @ 2022-09-15 23:19 daniel456 阅读(28) 评论(0) 推荐(0)
摘要:转自 https://blog.csdn.net/Peerless__/article/details/125458742 阅读全文
posted @ 2022-09-14 21:44 daniel456 阅读(16) 评论(0) 推荐(0)
摘要:https://www.yuque.com/qyuhen/go/yg5bcu 阅读全文
posted @ 2022-08-30 22:00 daniel456 阅读(29) 评论(0) 推荐(0)