编程笔记 GOLANG基础 004 GOLANG常用命令及VSCODE快捷键

简介: 编程笔记 GOLANG基础 004 GOLANG常用命令及VSCODE快捷键

在编写go语言代码之前,记住一些常用的方法,可以产生事半功倍的效果,如go语言开发程序的一些常用命令和开发工具的一些快捷键,之后还有编程的一些加速方法等。

一、GOLANG常用命令

直接在终端中输入 go help 即可显示所有的 go 命令以及相应命令功能简介。

PS D:\gott> go help
Go is a tool for managing Go source code.
Usage:
        go <command> [arguments]
The commands are:
        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
Use "go help <command>" for more information about a command.
Additional help topics:
        buildconstraint build constraints
        buildmode       build modes
        c               calling between Go and C
        cache           build and test caching
        environment     environment variables
        filetype        file types
        go.mod          the go.mod file
        gopath          GOPATH environment variable
        gopath-get      legacy GOPATH go get
        goproxy         module proxy protocol
        importpath      import path syntax
        modules         modules, module versions, and more
        module-get      module-aware go get
        module-auth     module authentication using go.sum
        packages        package lists and patterns
        private         configuration for downloading non-public code        
        testflag        testing flags
        testfunc        testing functions
        vcs             controlling version control with GOVCS
Use "go help <topic>" for more information about that topic.
PS D:\gott> 

需要的话自行翻译一下。

二、VSCODE快捷键

按ctrl+k,ctrl+s,即可显示键盘快捷方法列表。

常用快捷键

  1. 行注释 ctrl + /
  2. 块注释 shift+alt+a (可以修改为ctrl+shift+/)
  3. ctrl+a 全选
  4. ctrl+c 复制
  5. ctrl+v 粘贴
  6. ctrl+shift+k 删除行
  7. ctrl+e查找文件
  8. ctrl+shift+p 打开设置命令行
    修改快捷键
    双击要修改的快捷键,不建议修改。
相关文章
|
2月前
vscode 向下复制当前行功能快捷键 设置成Ctrl + D
vscode 向下复制当前行功能快捷键 设置成Ctrl + D
86 0
|
2月前
设置VSCode运行任务命令快捷键Alt+R,通常用于npm start(对频繁使用该命令可节省50%的输入命令行打字时间)
设置VSCode运行任务命令快捷键Alt+R,通常用于npm start(对频繁使用该命令可节省50%的输入命令行打字时间)
|
2月前
设置VSCode代码编辑器右侧的Minimap代码缩略图滚动条切换显示、隐藏的快捷键Alt+M
设置VSCode代码编辑器右侧的Minimap代码缩略图滚动条切换显示、隐藏的快捷键Alt+M
|
12天前
|
C++ iOS开发 MacOS
常用的 VSCode 快捷键【大全】,提升你的编码速度
常用的 VSCode 快捷键【大全】,提升你的编码速度
常用的 VSCode 快捷键【大全】,提升你的编码速度
|
2月前
|
JSON 编解码 Go
Golang深入浅出之-HTTP客户端编程:使用net/http包发起请求
【4月更文挑战第25天】Go语言`net/http`包提供HTTP客户端和服务器功能,简化高性能网络应用开发。本文探讨如何发起HTTP请求,常见问题及解决策略。示例展示GET和POST请求的实现。注意响应体关闭、错误处理、内容类型设置、超时管理和并发控制。最佳实践包括重用`http.Client`,使用`context.Context`,处理JSON以及记录错误日志。通过实践这些技巧,提升HTTP编程技能。
38 1
|
2月前
|
Go 开发者
Golang深入浅出之-HTTP客户端编程:使用net/http包发起请求
【4月更文挑战第24天】Go语言的`net/http`包在HTTP客户端编程中扮演重要角色,但使用时需注意几个常见问题:1) 检查HTTP状态码以确保请求成功;2) 记得关闭响应体以防止资源泄漏;3) 设置超时限制,避免长时间等待;4) 根据需求处理重定向。理解这些细节能提升HTTP客户端编程的效率和质量。
29 1
|
2月前
|
SQL 关系型数据库 MySQL
Golang数据库编程详解 | 深入浅出Go语言原生数据库编程
Golang数据库编程详解 | 深入浅出Go语言原生数据库编程
|
2月前
个人建议:VSCode和WebStorm中的“关闭其他所有编辑器、关闭左侧编辑器、关闭右侧编辑器”快捷键这么设置shift+alt+w、shift+alt+[、shift+alt+],你会受益匪浅
个人建议:VSCode和WebStorm中的“关闭其他所有编辑器、关闭左侧编辑器、关闭右侧编辑器”快捷键这么设置shift+alt+w、shift+alt+[、shift+alt+],你会受益匪浅
|
2月前
|
搜索推荐 开发者
VSCode快捷键使用教程:提高编码效率的利器
本文介绍了提升编程效率的VSCode快捷键使用方法。主要包括编辑、导航、查找与替换、格式化等快捷键,如Ctrl+A全选,Ctrl+P前往文件,Ctrl+F查找,Shift+Alt+F格式化代码。此外,还涉及窗口和菜单快捷键,如新建窗口(Ctrl+Shift+N)、切换分屏(Ctrl+左右箭头)。VSCode也支持用户自定义快捷键,通过Ctrl+,打开设置进行个性化配置。
90 0
|
2月前
|
Windows
vscode 终端无法执行npm、cnpm命令的解决办法,npm : 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试
vscode 终端无法执行npm、cnpm命令的解决办法,npm : 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试
382 0