GO Liteide using

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

For the Go Language development environment is recommended on the Internet is liteide of course, now the major mainstream IDE tools have plug-in support such as Eclipse,intellij.

So today we will talk about some of the pits Liteide met.


First we need to install go first, by default the go is installed automatically goroot (Windows).

Next Download Liteide http://www.golangtc.com/download/liteide


After the installation, we will carry out our Hello World

We can do it with decompression liteide (not very lightweight)


Here to focus on the environment settings



This environment setting mainly involves your build install and so on (settings including goroot,gopath,gobin), etc.


Here to focus on the relevant information

For Goroot: Equivalent to Javahome mainly includes Go's boot file, basic package (library) files, etc.

For Gopath: The environment variable equivalent to Javaclasspath is the Go User development package can be used; (:) split

For Gobin: The specified bin directory may not be set when the main go language is installed. This is set to the D:\go\bin equivalent to the generated EXE file to put here


Let's execute a Hello World example

First create a main file Portal main package:


Choose Command Project here (equivalent to the main entry of the project)

Build a dependent package at the same time


Choose Package Project Here

Set the Hello function in Hello

  Hello project hello.go 
Package Hello
Import"FMT"
FuncHello (whostring){
 FMT. Printf ("Hello,%s!\n",who)
}

Reference the Hello package in the main package and use the Hello function

  test Project Main.go 
Package Main
Import(
  "Hello"
)
FuncMain (){
 Hello. Hello ("go!")
}
Execute BR to build


Execution results

C:/go/bin/go.exe build-i [D:/go/src/test]

Success: Process exit code 0.

D:/go/src/test/test.exe [D:/go/src/test]

Hello, go!!.

Success: Process exit code 0.

Generate Test.exe files at the same time:



Execute the Install method (right click on the test directory):




Generate File:

Bin



Pkg




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.