Introduction

This is the notes written for the learning of GoLang Structure

The stucture of a typical GoLang program should be like this:

bin/
    mathapp
pkg/
    darwin_amd64/
         mymath.a
         github.com/
              astaxie/
                   beedb.a
src/
    mathapp
          main.go
    mymath/
          sqrt.go
    github.com/
           astaxie/
                beedb/
                    beedb.go
                    util.go

bin/ is responsable for the execuable after compiling
pkg/ is responsable for the private packages and downloaded packages
src/ is for the surce code

Go commands

go build: Compile the source code and the related packages if necessary.
For normal packages, if you intend to generate corresponding files in $GOPATH/pkg, use go install instead. For package including "main", one executable file will be generated afterwards in the current path

go clean: delete those unnecessary realaying files
go fmt: formating the file you select.
go get: dramatically and remotely get the packages from the server,
go install: generate .a or executable files and move it to GOPATH/pkg* or *GOPATH/bin

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,183评论 0 10
  • 还没睁开眼月亮已经偏移云卷着风扫了一筐星倒进黑暗的漩涡里 呼吸变成多余起伏的不再是身体而是一百年那么长的孤寂摘不开...
    苏坡拉底阅读 2,934评论 4 6
  • 今天开始分享《母爱的羁绊》,作者:美国 卡瑞尔·麦克布莱德博士 著 “爱来自父母,令人悲哀的是,伤...
    解欣阅读 6,978评论 0 0
  • 生命是一种状态,以何种状态面对生活是个人的选择。 每个人来到这个世界上,受家庭、教育、社会等等...
    小蒜瓣阅读 2,849评论 0 1
  • 以前以为的孤独便是独自一人吃饭,逛街,看书,出去旅行。而自己却是时时有人陪着去经历那些,甚至曾一度的远离她们,特意...
    翊昕浅笑阅读 1,684评论 0 0

友情链接更多精彩内容