golang 標準命令詳解

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

去年工作原因,接觸到了golang,今年開始,自身感興趣,開始在自學Golang。首先簡短介紹下golang,Go語言是Google開發的一種編譯型,並髮型,具有記憶體回收功能的系統程式設計語言,官方支援FreeBSD,Linux,Mac OS和Windows四大作業系統。其出於Google公司,由眾多業界頂尖認識主持設計和開發,其設計動機就是為瞭解決伺服器端開發中遇到的實際問題,加上開源屬性,吸引了越來越多的開發人士參與。

 

golang的優點就不一一列舉了,本人對其高並發、多核支援,輕量級的goroutine和channel設計情有獨鐘。相關golang方面的學習資料可推薦官方網站、《go語言聖經》等等,github上可研讀相關優秀golang開源項目

 

本篇文章主要講述golang的命令工具,大致描述下golang的相關命令,以便在開發過程中,好好利用工具,事半功倍。

 

Go 語言內建了一套完整的命令操作工具,我們可以在命令列中執行go來查看相關協助

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    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 packagesUse "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 functionsUse "go help [topic]" for more information about that topic.

這些命令對於我們平時編寫的代碼非常有用,後續我們逐一詳細地來瞭解一些常用命令。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.