Go语言的学习

1.配置环境变量

 

2.本地阅读报的说明和文档 不用FQ

 

window+R  出现黑窗口   执行    godoc -http :8080 

在本地浏览器 localhost:8080 回车

3多行注释  /**/

4关键字 25 

const  PI =3.14     //常量的声明

type newType //一般类型

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

//结构声明

type gopher struct {}

//接口

type golang interface{}

 

5.导包小技巧

import (

  "fmt"

   "os"

)

6 hello world!

package main

 

func main() {

  fmt.Println("hello world!")

}

7.使用省略调用 或别名  两者不能同时存在

<1使用别名

<2

8.大小写 

大写 public 可以被调用

小写相当于 private

 

三 类型与变量

//变量组 函数中不能声明!

如var (

...

)

unint8 byte  0-255

 

posted @ 2015-12-01 02:24  一座城池2012  阅读(190)  评论(0编辑  收藏  举报