Some records of Go

Source: Internet
Author: User
Tags gocode
This is a creation in Article, where the information may have evolved or changed.

Drwxr-xr-x 4 B Staff 136 APR 23:28 SRC

Drwxr-xr-x B Staff 510 APR 23:00 Web

Drwxr-xr-x 4 B Staff 136 APR 23:24 Web.go

-rw-r--r--1 B Staff 434 Mar 19:34 Xiec.go


The go package you choose will be installed under the Gopath according to the entire path, if it is from GitHub down to the assembly, take this as an example

Go get Github.com/astaxie/beego

You will find the following path in the self-directory.

Golang/src/github.com/astaxie

gaoling/src/golang.org/-------



Here is a step to create a workspace:

Create the $HOME/mygo directory and the SRC directory as the source code.

mkdir$HOME# create a place to put source code 

The next step is to set up Gopath, and you should put the bin directory under this directory in the PATH environment variable so that you can execute directly at the command line without giving the full directory.

export GOPATH=$HOMEexport PATH=$PATH:$HOME/mygo/bin
The benefit of the following export path is that you can directly consume Mygo under the compiled Bin directive, and I see that there is actually no bin directory



gopath=/home/ user/gocode/home/ user/gocode/ src/foo/b ar/(Go code in  package  bar) x.go quux/(Go code in  package  Main) y.go Bin/quux (installed command) pkg/linux_amd64/ FOO/BAR.A (Installed package  Object )
Create these directories manually

==

Mycode/golang/bin

You need to build the bin directory and then pkg to generate the file


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.