CentOS 7 Golang Gogs Deployment

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

CentOS 7 Golang Gogs Deployment

It's been a long time since I've had a few minutes to record things, and it's very troublesome to use them.

Installation of Golang

install go

This native installation, however, seems to be a problem with Docker's environment, mainly gorootpath problems, which can result in a subsequent go get error (import path does not begin with hostname),

Cd/tmpcurl-lo Https://storage. Googleapis. com/golang/go1. 7. Linux-amd64. Tar. GZShasum-a theGo1. 7*. Tar. GZsudo tar-c/usr/local-xvzf go1. 7. Linux-amd64. Tar. GZMkdir-p ~/projects/{bin,pkg,src}sudo Vi/etc/profile. D/path. SHExport path= $PATH:/usr/local/go/binvi ~/. Bash_profile#export gobin= "$HOME/projects/bin"#export gopath= "$HOME/projects/srcexport"#GOROOT = "/path/to/go"Source/etc/profile && Source ~/. Bash_profile

Here's how I handled the error:
I Think you installed Go in/usr/local/go.
So change your goroot path to the value Of/usr/local/go/bin.

It seems meant to has your workspace (Gopath) located at/home/me/go.

This might fix your problem.
Add this to the bottom of your bash profiles, located here = $HOME/.profile

export GOROOT=/usr/local/goexport GOPATH=$HOME/goexport PATH=$PATH:$GOROOT/bin

Here are the commands that link database permissions:

grant all privileges on *.* to root@'%' identified by "mima";flush  privileges;

Gogs Official source installation [1]: https://gogs.io/docs/installation/install_from_source.html
Go installation [2]: https:// Www.digitalocean.com/community/tutorials/how-to-install-go-1-7-on-centos-7
Resolution of the error [3]:/http Stackoverflow.com/questions/20458796/unrecognized-import-path-with-go-get

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.