Go - helloworld in eclipse


Introduction
When trying the first helloworld, I encountered some problem to setup environment. So note here.
You can find manual for complete information, here is just what I remember work for me.

Install Eclipse & Install Go
skip.. You can execute 
go version
to check is Go installed

Setup Env (Win10)
goroot
You don't need to set it, it was set to installed folder automatically in my machine
Set env: GOROOT={InstalledPath}

gopath
Set to a location for Go workspace
Set env: GOPATH={USERHOME}/Go
Remember to create this folder by yourself, otherwise eclipse may encounter problem

path
Add {Go installation}/bin
Check env

Eclipse
Download tools
Windows -> Preference -> Go -> Tools
Helloworld
Prepare script
This file need to be put under main folder, because it needs to be in main package
package main
import (
       "fmt"
)
func main() {
       fmt.Print("hello world")
}
File structure
Finally you can run the script to get helloworld print result


沒有留言:

張貼留言

別名演算法 Alias Method

 題目 每個伺服器支援不同的 TPM (transaction per minute) 當 request 來的時候, 系統需要馬上根據 TPM 的能力隨機找到一個適合的 server. 雖然稱為 "隨機", 但還是需要有 TPM 作為權重. 解法 別名演算法...