Go命令

作者: weifansym | 来源:发表于2019-02-18 00:19 被阅读0次

假如你已安装了golang环境,你可以在命令行执行go命令查看相关的Go语言命令:

$ go
Go is a tool for managing Go source code.

Usage:

    go command [arguments]

The commands are:

    build       compile packages and dependencies
    clean       remove object files
    doc         show documentation for package or symbol
    env         print Go environment information
    bug         start a bug report
    fix         run go tool fix on packages
    fmt         run gofmt on package sources
    generate    generate Go files by processing source
    get         download and install packages and dependencies
    install     compile and install packages and dependencies
    list        list packages
    run         compile and run Go program
    test        test packages
    tool        run specified go tool
    version     print Go version
    vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

    c           calling between Go and C
    buildmode   description of build modes
    filetype    file types
    gopath      GOPATH environment variable
    environment environment variables
    importpath  import path syntax
    packages    description of package lists
    testflag    description of testing flags
    testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

go env用于打印Go语言的环境信息。

go run命令可以编译并运行命令源码文件。

go get可以根据要求和实际情况从互联网上下载或更新指定的代码包及其依赖包,并对它们进行编译和安装。

go build命令用于编译我们指定的源码文件或代码包以及它们的依赖包。

go install用于编译并安装指定的代码包及它们的依赖包。

go clean命令会删除掉执行其它命令时产生的一些文件和目录。

go doc命令可以打印附于Go语言程序实体上的文档。我们可以通过把程序实体的标识符作为该命令的参数来达到查看其文档的目的。

go test命令用于对Go语言编写的程序进行测试。

go list命令的作用是列出指定的代码包的信息。

go fix会把指定代码包的所有Go语言源码文件中的旧版本代码修正为新版本的代码。

go vet是一个用于检查Go语言源码中静态错误的简单工具。

go tool pprof命令来交互式的访问概要文件的内容。
标准命令详解

相关文章

  • Go语言命令行工具介绍-3

    章节 命令-go build 命令-go run 命令-go get 1.go build 用于编译源码文件、代码...

  • Golang命令

    Go命令教程 (访问密码:kmNYam)Go命令教程 go buildgo build命令用于编译我们指定的源码文...

  • Go命令

    假如你已安装了golang环境,你可以在命令行执行go命令查看相关的Go语言命令: go env用于打印Go语言的...

  • Golang中的常用命令

    Go命令行有常用的这几个命令: go build 编译包和依赖 go run 编译和运行go程序 go insta...

  • 【命令】go mod

    记录常用的go mod命令 常用命令 查看 GO111MODULE 是否打开go env 打开go modules...

  • go环境变量

    Go语言环境安装完成后,可以使用 go env命令查看环境变量,打开命令终端执行go env命令,输出内容如下: ...

  • Go语言命令行操作命令详细介绍

    序 这篇文章主要介绍了Go语言命令行操作命令详细介绍,本文重点介绍了go build、go clean、go fm...

  • 3.Golang最常用命令

    一、命令格式# go [arguments] 二、Go 最常用的几个命令 build 命令,构建可执行文件使用...

  • Go1.11 module 简明使用指南

    Go Mod 命令 其它命令可以通过go help mod来查看。 设置 GO111MODULE 可以用环境变量 ...

  • Go语言实战笔记(二)| Go开发工具

    在Go语言中,我们很多操作都是通过go命令进行的,比如我们要执行go文件的编译,就需要使用go build命令,除...

网友评论

      本文标题:Go命令

      本文链接:https://www.haomeiwen.com/subject/vekoeqtx.html