码迷,mamicode.com
首页 > 其他好文 > 详细

GO基础-第一部分

时间:2018-05-24 18:23:10      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:pac   lan   str   程序包   接口   全局   port   const   全局变量   

1.package 程序包 package main 

2.import  //导入其他程序包

import "fmt"

换成别名 点号 省略调用

import std “fmt” //可以进行别名

3.const 常量的声明

4.var 全局变量的声明

5. type newType int 一般类型的声明

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

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

8.func main(){} //函数

GO基础-第一部分

标签:pac   lan   str   程序包   接口   全局   port   const   全局变量   

原文地址:https://www.cnblogs.com/xiaohaio/p/9083825.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!