package main
import (
"fmt"
//"strconv"
//"goLand/dog"
//"goLand/dog"
//"goLand/testpkg"
)
func main() {
// 关键字 变量名 变量类型 = 变量值
//var a string = "hello world a"
// 隐式声明变量
//b := "hello world b"
// 关键字不能作为变量名
/*
* 包管理 import package
* 程序实体声明与定义 chan const func interface map struct type var
* 程序流程控制 break case continue default defer else fallthrough for go goto if range retrun select switch
* 36个预定义表示符 append bool byte cap close complex 64 128 uint 8 16 32 64 copy false float32 64 image int 8 16 32 64
* iota len make niw nil panic print println real recover string true uintptr
*/
// 包里面变量名或者方法名 大写开头的其他包才可以引用
// fmt.Println(testpkg.A)
// fmt.Println(dog.Name)
/*
go语言数据类型{
基本数据类型:
整形{
// 系统是32位则int/uint为32位 64位 则为64位
uint 8/16/32/64
int 8/16/32/64
}
浮点类型{
float32 float64 // 一般情况下使用float64
}
字符串类型{
string
}
bool{
true
false
}
复杂数据类型{
struct
interface
array()
slice
*
func
func
}
}
*/
/*
golang流程控制{
递增递减{
++ 自增
-- 自减
}
条件语句{
if
if else
if else if else
}
选择语句{
// go 默认break 如果想向下执行 加关键字 fallthrough
switch expr {
case 0:
fmt.Println("0")
case 1:
fmt.Println("1")
case 2:
fmt.Println("2")
default:
fmt.Println("other")
}
循环语句{
// break 跳出循环
// continue 跳出本次循环
// goto 跳转语句 A: break A goto B B:
for {}
for a := 0; a < 3; a++ {}
for a < 3 {}
}
}
}
*/
// 查看变量类型
//fmt.Printf("%T", string)
// 数据类型转换
//int, _ := strconv.Atoi(string1)
fmt.Println("")
}