摘要: 一、new 函数原型:func new(Type) *Type函数作用:用来分配内存,只有是一个参数,参数为类型,它的返回值是一个指向新分配类型的指针,并且内存置为零。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 package main import "fmt" fun 阅读全文
posted @ 2022-01-15 17:07 gtea 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 彻底搞懂golang的GOROOT和GOPATH go安装依赖包(go get, go module):https://blog.csdn.net/weixin_41519463/article/details/103501485 : 1、GOPATH 和 GOROOT不同于其他语言,go中没有项目 阅读全文
posted @ 2022-01-15 15:39 gtea 阅读(1196) 评论(0) 推荐(0) 编辑
摘要: 原文链接:VS Code 中的代码自动补全和自动导入包 文章目录 其他 参考资料 VSCode 必须安装以下插件: 首先你必须安装 Golang 插件,然后再给 Go 安装工具包。 在 VS Code 中,使用快捷键:command+shift+P,然后键入:go:install/update to 阅读全文
posted @ 2022-01-15 14:25 gtea 阅读(7341) 评论(0) 推荐(0) 编辑