Build and run Go in Cloud 9

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

Brief introduction

Since the use of Chromebook, my mind has been flooded with the idea of developing in the cloud. I'm only happy with Cloud 9 in an online development environment where I've used a few bits. In fact, Cloud 9 doesn't support go development, so I'll teach you how to get go running on Cloud 9.

Create your workspace

The first step is to create a workspace, named according to your preferences.

When the workspace is created, click the Start Edit button and you'll see a blank workspace and a readme.md file (it doesn't matter if you delete it).

At the bottom of the workspace, you can see the console, which is where we're going to do it next. If you want to use a more pure console, you can start it in the following location:

View > Terminals > New Terminal

The best part of C9 is its virtual environment, and if you're familiar with the command line under Linux, it's easy to get started. Now that we've opened the working environment, let's start configuring it.

When you first enter the workspace, You will see the following prompt:

just now we need a place to download go. We can put it in the home directory, enter the following command to enter the specified directory:

Cd..

Now we can start to download go, when I write this blog, the latest version is 1.1.1:

Https://go.googlecode.com/files/go1.1.1.linux-amd64.tar.gz

After the download is complete, extract the compressed package:

Tar-xzf go1.1.1.linux-amd64.tar.gz

When the decompression is complete, you can see a go folder in your home directory. As for the compression package, delete it, no need.

Configuring the Environment

The final step is to configure the development environment so that the IDE can recognize the go component and our go code files, so we need to edit the bash configuration. C9 provides the VIM editor on the command line:

Vim ~/.BASHRC

Add the following to the. bashrc file:

# Setup Go configuration export goroot= $HOME/go export path= $PATH: $GOROOT/bin # Setup Workspace export gopath= $HOME/562166 Export path= $PATH: $GOPATH/bin

The previous few file paths now come in handy, there's Wood there ~ update above Gopath for you to write down the address instead of what I wrote here ($HOME/562166).

Save. BASHRC, Reload configuration:

SOURCE ~/.BASHRC

Get! Now you can go the full way. \ (^o^)/~


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.