编程笔记 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 打开设置命令行
    修改快捷键
    双击要修改的快捷键,不建议修改。
相关文章
|
8月前
|
机器学习/深度学习 人工智能 自然语言处理
|
11月前
|
Unix Linux Go
go进阶编程:Golang中的文件与文件夹操作指南
本文详细介绍了Golang中文件与文件夹的基本操作,包括读取、写入、创建、删除和遍历等。通过示例代码展示了如何使用`os`和`io/ioutil`包进行文件操作,并强调了错误处理、权限控制和路径问题的重要性。适合初学者和有经验的开发者参考。
191 4
|
12月前
|
前端开发 JavaScript 数据库
VSCode编程助手工程能力体验报告(一):通义灵码 - 帮你高效切入新项目、编码和提升质量
我是一位软件工程师,用通义灵码个人版vscode插件的workspace做项目分析和复盘,对比之前没有灵码,现在提效了80%,本文介绍了具体的使用流程。
2682 3
|
12月前
|
自然语言处理 JavaScript 开发者
通义灵码插件:VSCode 的智能编程助手
通义灵码插件:VSCode 的智能编程助手
6873 4
|
数据库连接 Go API
Golang中的25个常见错误:更好地进行go编程的综合指南
Golang中的25个常见错误:更好地进行go编程的综合指南
|
Dart
Flutter笔记:手动配置VSCode中Dart代码自动格式化
Flutter笔记:手动配置VSCode中Dart代码自动格式化
1463 5
|
JavaScript 前端开发 开发者
【颠覆你的前端世界!】VSCode + ESLint + Prettier:一键拯救Vue代码于水深火热之中,打造极致编程体验之旅!
【8月更文挑战第9天】随着前端技术的发展,保持代码规范一致至关重要。本文介绍如何在VSCode中利用ESLint和Prettier检查并格式化Vue.js代码。ESLint检测代码错误,Prettier保证风格统一。首先需安装VSCode插件及Node.js包,然后配置ESLint和Prettier选项。在VSCode设置中启用保存时自动修复与格式化功能。配置完成后,VSCode将自动应用规则,提升编码效率和代码质量。
1005 1
|
人工智能 自然语言处理 JavaScript
阿里云发布 AI 编程助手 “通义灵码”——VSCode更强了 !!
阿里云发布 AI 编程助手 “通义灵码”——VSCode更强了 !!
1434 3
|
JSON 编解码 Go
Golang深入浅出之-HTTP客户端编程:使用net/http包发起请求
【4月更文挑战第25天】Go语言`net/http`包提供HTTP客户端和服务器功能,简化高性能网络应用开发。本文探讨如何发起HTTP请求,常见问题及解决策略。示例展示GET和POST请求的实现。注意响应体关闭、错误处理、内容类型设置、超时管理和并发控制。最佳实践包括重用`http.Client`,使用`context.Context`,处理JSON以及记录错误日志。通过实践这些技巧,提升HTTP编程技能。
201 1
|
Go 开发者
Golang深入浅出之-HTTP客户端编程:使用net/http包发起请求
【4月更文挑战第24天】Go语言的`net/http`包在HTTP客户端编程中扮演重要角色,但使用时需注意几个常见问题:1) 检查HTTP状态码以确保请求成功;2) 记得关闭响应体以防止资源泄漏;3) 设置超时限制,避免长时间等待;4) 根据需求处理重定向。理解这些细节能提升HTTP客户端编程的效率和质量。
183 1

热门文章

最新文章

推荐镜像

更多