美文网首页
Introduction

Introduction

作者: 曹小恒 | 来源:发表于2018-10-24 00:21 被阅读0次

    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

    相关文章

      网友评论

          本文标题:Introduction

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