//当前程序的包名 package main //导入其他的包 import ( io "fmt" ) //常量的定义 const PI = 3.14 //全局变量的声明与赋值 var name = "gohelper" //一般类型声明 type newType int //结构的声明 type gopher struct { } //接口的声明 type golang interface{} //由main函数作为程序入口启动 func main() { //局部变量 var a int = 65 b := string(a) io.Println(b) var c string = "你好" io.Println("hello world!你好,世界!") io.Println(c) }