Hello, world

package main
import "fmt"

func main() {
    fmt.Printf("Hello, world or 你好,世界 or καλημ ́ρα κóσμ or こんにちはせかい\n")
}

This is the simplest program to print "Hello, world".

Go program is organized to gether by packages, the first line indicate the package which it belongs to. The package "main" indicates that it is a independent package(a executable after compiling). Other .go will generate .a file in $GOPATH/pkg/darwin_amd64.

Every independently executable .go should possess a package main including a entry function called main without parameters or return values.

The concept packages here is like the packages in Python, which is great for modularization and reusablity.

Go is born to support UTF-8, one of Go's founder is also the advocator of UTF-8

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,424评论 0 10
  • 妈妈一天都躺在床上,还发出呻吟声!然后交代我做事情,问她肚子饿不饿,她说不饿,问她鸡蛋吃不吃,她说不能吃的,我的火...
    竺子阅读 167评论 0 0
  • 每个人都有母亲 每个母亲都是一个活生生的人, 每一个活生生的人都在体验每一刻的苦与乐 每一刻都能全然的活着 就是你...
    静心独舞阅读 189评论 0 1
  • 表哥事件前,男士手腕上的那块表似乎隐隐约约成为某种品味身份的象征,最贵的百达翡丽Henry Gres超复杂功能怀表...
    丹菡阅读 617评论 0 3