beego installation environment

1. Install go locale

  Install epel source

yum install -y epel-release  (CentOS)

  Installation golang

1.yum provides go  (搜索golang属于哪个包)
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
golang-1.11.5-1.el7.x86_64 : The Go Programming Language
Repo        : epel
Matched from:
Provides    : go = 1.11.5-1.el7 
2.yum install -y golang-1.11.5-1.el7.x86_64 (go and installation dependent)

2. Install beego

go get -u github.com/astaxie/beego

3. Install Tool bee

go get -u github.com/astaxie/bee

4. beego output Hello

   vim beego.go writes the following

package main

import (
        "github.com/astaxie/beego"
)

func main() {
        beego.Info("Hello,beego")
}

5. Do beego.go

  There are two ways:

  1. Compile execution

Build beego.go Go 

./beego (recommended, dependent on the good compiler package after linux is the most basic package, static executable)

  2. Not compile and run

go run beego.go

Guess you like

Origin www.cnblogs.com/tianxie11/p/10978926.html