Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
檀越@新空间
Coding Tree
提交
8a8b6ed3
C
Coding Tree
项目概览
檀越@新空间
/
Coding Tree
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Coding Tree
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8a8b6ed3
编写于
8月 30, 2022
作者:
彭世瑜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
54b83db5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
76 addition
and
15 deletion
+76
-15
blog/golang/code/src/demo.go
blog/golang/code/src/demo.go
+11
-2
blog/golang/code/src/go.mod
blog/golang/code/src/go.mod
+2
-0
blog/golang/code/src/go.sum
blog/golang/code/src/go.sum
+2
-0
blog/golang/golang-install.md
blog/golang/golang-install.md
+61
-13
未找到文件。
blog/golang/code/src/demo.go
浏览文件 @
8a8b6ed3
package
main
package
main
import
(
"fmt"
uuid
"github.com/satori/go.uuid"
)
func
main
()
{
func
main
()
{
fmt
.
Println
(
""
)
// Creating UUID Version 4
}
uuid
:=
uuid
.
NewV4
()
\ No newline at end of file
fmt
.
Printf
(
uuid
.
String
())
// f521f6bb-d809-43ad-8968-ab9e763d0eba
}
blog/golang/code/src/go.mod
浏览文件 @
8a8b6ed3
module code
module code
go 1.19
go 1.19
require github.com/satori/go.uuid v1.2.0 // indirect
blog/golang/code/src/go.sum
0 → 100644
浏览文件 @
8a8b6ed3
github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
blog/golang/golang-install.md
浏览文件 @
8a8b6ed3
...
@@ -24,22 +24,23 @@ $ sudo launchctl list | grep ssh
...
@@ -24,22 +24,23 @@ $ sudo launchctl list | grep ssh
- 0 com.openssh.sshd
- 0 com.openssh.sshd
```
```
> vscode快捷键:
vscode快捷键:
> 快速复制一行:shift + option + 方向键向下
> 字体大小修改:command +/-
-
快速复制一行:shift + option + 方向键向下
> 行注释:command + /
-
字体大小修改:command +/-
> 块注释:shift + option + a
-
行注释:command + /
> 全选:command + a
-
块注释:shift + option + a
> 复制:command + c
-
全选:command + a
> 粘贴:command + v
-
复制:command + c
> 删除行:command + shift + k
-
粘贴:command + v
> 命令行:command + shift + p
-
删除行:command + shift + k
> 整体向右移动 tab
-
命令行:command + shift + p
> 整体向左移动 shift + tab
-
整体向右移动 tab
-
整体向左移动 shift + tab
安装插件
安装插件
-
[
https://marketplace.visualstudio.com/items?itemName=golang.Go
](
https://marketplace.visualstudio.com/items?itemName=golang.Go
)
-
[
https://marketplace.visualstudio.com/items?itemName=golang.Go
](
https://marketplace.visualstudio.com/items?itemName=golang.Go
)
-
[
https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
](
https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
)
-
[
https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
](
https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
)
## 安装 Golang1.9.2
## 安装 Golang1.9.2
...
@@ -333,4 +334,51 @@ Dos Disk Operating System 磁盘操作系统
...
@@ -333,4 +334,51 @@ Dos Disk Operating System 磁盘操作系统
```
```
终端 --> Dos操作系统 --> Windows目录
终端 --> Dos操作系统 --> Windows目录
```
## Go常用命令
```
bash
$
go
help
bug start a bug report
build compile packages and dependencies
clean remove object files and cached files
doc show documentation
for
package or symbol
env
print Go environment information
fix update packages to use new APIs
fmt
gofmt
(
reformat
)
package sources
generate generate Go files by processing
source
get add dependencies to current module and
install
them
install
compile and
install
packages and dependencies
list list packages or modules
mod module maintenance
work workspace maintenance
run compile and run Go program
test test
packages
tool run specified go tool
version print Go version
vet report likely mistakes
in
packages
```
管理依赖包
搜索包:https://pkg.go.dev
```
bash
# 初始化模块
go mod init code
# 下载依赖
go get github.com/go-sql-driver/mysql
```
快捷输入
```
go
pkgm
ff
for
forr
fmain
a
.
print
```
```
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录