您的位置:首页 > 编程语言

Go编程基础—常见结构

2017-07-08 18:43 239 查看


basic_structure.go

// 当前程序的包名
package main

// 导入其它的包 ,std为fmt包的别名
import std "fmt"

// 常量的定义
const PI = 3.14

// 全局变量的声明与赋值
var name = "gopher"

// 一般类型声明
type newType int

// 结构的声明
type gopher struct{}

// 接口的声明
type golang interface{}

// 由 main 函数作为程序入口点启动
func main() {
std.Println("Hello world!你好,世界!")
}








内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: