Beego Precautions for building Golang

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

As we all know, at the time of learning Golang, everyone will pay attention to the Beego rapid development architecture of Xie Da.

First of all, the younger brother is Win7 32bit system, here, I want to learn the process of Golang and small experience record up.

Believe that the people who want to learn will be installed early on the go, simple and lightweight convenient, no words can be downloaded here.

When you install go 1.2, you will slowly discover that there are too many things you need to do in the Windows environment.

If you just look at the tutorials, I think you might as well have some problems with me. will be mentioned later.

At this time you need a Golang IDE, although everyone said sublime text is more useful, but I have not used before, do not understand this. So I chose the official recommended Liteide x20.1.

Only therefore will write this article, is because I have been tossing for a long time, to this process has the point excessive excitement inside.

After you install go, you will find command Prompt that can identify go under cmd.

Yes, because in the default installation directory C:\Go under the bin, there is a go.exe, Godoc.exe, Gofmt.exe.

I forgot when they were there. I only remember that I used to see Go's official Grammar tutorial, I executed go doc in cmd (The nameless video, Xie Da's book All mentioned).

First we will go to Cmd:go env for an environment view. As follows:

That's it, that's where I started. The environment variables to note here are: Gopath,gobin,goroot.

Because I started gopath, there is no. So I created the F:\Go\Development.

In turn, if you have doubts about the open source language, I'm in the door with doubts anyway. The first time I contacted GIT,HG.

Because I want to know about the go world on GitHub. So, I need to use Git.

Have to mention git is how easy to use, easy to use to my command prompt all old love to knock on. (The Novice does)

When I was in Git:go get, I unexpectedly found the error: Gopath not found. A similar problem.

I'll look back and see if Gopath is present or not. Discover, exist, yes.

Then, I was depressed. Strange, good will report Gopath not set error.

Later found that a group of friends have also encountered such problems. Originally, win7 the user variable also to set. It's finally done!

Then, I was very simple to beat the Consolo code, hey. Strange, every time in the user/username under the production of a UserName.exe.

That's why I'm deceptive today. The original Gobin is empty. fainted, the tutorial is like this: Well, at least there's a UserName.exe for me to output.

When I was going to write a simple web version of Hello World, I found it strange. How does go solve the routing mechanism on a Web project? Walking with doubts.

It seems that thanks to the book, there is a Chapter ' Web Foundation '. In this, the post-compilation EXE executes the same principle as the go-to-run IIS. is also very beneficial.

But I care more about is go in the development time of the web principle, that is to say: I under the Beego, generate Beego not get bee.exe.

I am also confused is, in compiling beego when I go to git:go get a few packape. Compile through, I go build, install Beego. But I still haven't seen the Beego.exe.

Later, after thinking source brother 's guidance, I know, originally I gobin is empty. Set Gobin=%goroot%\bin. Remember my Computer-properties-environment variables.

I don't understand such an important thing.

Then I found a bee.exe in the bin under the Gopath. Okay, so this guy decided to identify my cmd bee command.

Alas, after I set gobin, it should be that the go build will produce exe.

In fact, I have been wrong, Siyuan eldest brother said that as long as the go get will automatically install, automatically generated exe.

But I didn't. Then, in my doubts, I also went to see Path:echo%PATH%. Found to be C:\GO\BIN. Change decisively into%gobin%.

At this time I also made a test, Gobin changed to%gopath%\bin found even go cmd can not recognize.

In fact, I do not understand, in the Beego compiled through the process, we are going to go get bee. Bee build install can make Bee.exe,bee.exe under Gopath\bin, I thought it was right.

However, the CMD reboot still does not recognize the bee command.

Then I'm on fire, just copy bee to Gobin. Then, Cmd:bee, happy dead brother, this can be met!

I just created a web of Hello World, and then I Cmd:bee new hello.

A little doubt, thought source brother said: Beego is also strict. That is, only the Gopath path is allowed to create the Beego Web. Of course, Gopath allows multiple.

haha Finally successfully!

Because I am a novice, so many doubts in the inside. Then slowly in the elder brother 's guidance, I also perfected this series of development environment.

To not affect port collisions, the app.conf port was changed to 8089 by me, as follows:

If you are a novice, I hope to help you.

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.