Golang学习笔记 (一)
来源:互联网 发布:网络拓扑图图片 编辑:程序博客网 时间:2024/05/22 06:07
小记一下go的语法,风格
- 关于Exported names ,首字母不是大写的都不能作为输出。也不能被导入到另一个包中然后使用。
- int型在32位系统上为32位,在64位系统上为64位,和C一样。
- Variables declared without an explicit initial value are given their zero value.变量未被赋值时:0 for numeric types,
false the boolean type, and
“” (the empty string) for strings. - import :在同时引入多个包时,可以放在括号中。如
import ( "fmt" "math" )
- Type conversions:类型转换 The expression T(v) converts the value v to the type T. 类型转换时,必须显式转换,Unlike in C, in Go assignment between items of different type requires an explicit conversion.
- Type inference: the variable’s type is inferred from the value on the right hand side.
- fmt.Printf() fmt.Printfln()(输出行)
Constants:
Constants are declared like variables, but with the const keyword.*Constants can be character, string, boolean, or numeric values.* *Constants cannot be declared using the := syntax.*
-
0 0
- Golang学习笔记 (一)
- golang snmp开发学习笔记(一)
- golang学习笔记之并发优化(一)
- Golang---walk学习(一)
- Golang 学习摘录(一)
- golang snmp开发学习笔记(二)
- GoLang学习基础笔记
- Golang学习笔记//序
- Golang Log 学习笔记
- Golang学习笔记:常见问题
- Golang学习笔记
- golang学习笔记
- golang学习笔记
- golang学习笔记
- Golang学习笔记 函数
- golang 学习资料笔记
- golang学习笔记
- golang并发学习笔记
- Unix c 网络编程 UDP
- iOS开发计算文本尺寸
- uva 10167
- 汇编语言-[BX]和loop指令
- nyoj914Yougth的最大化【二分+贪心】
- Golang学习笔记 (一)
- poj 2406 Power Strings
- 凸优化中的数学基础知识(范数篇一)内积,欧式范数
- iOS UIView的常见属性
- 各种元素水平垂直居中
- 阿里无线前端性能优化指南 (Pt.1 加载期优化)
- Android 中解决图片加载OOM 之 bitmap 压缩显示,压缩上传
- 按钮的样式
- Spring横切面(advice),增强(advisor),切入点(PointCut)