The Go Programming Language (Golang)

栏目: Go · 发布时间: 7年前

内容简介:<font color=red >note</font>:在 if 语句中,若检验条件为 i >= 0,则 i 的类型不宜为 uint 型(uint 数据始终 >= 0)

基本类型:

  • 数值
    • 整型:int int8 int16 int32(rune) int64 uint uint8((byte)) uint16 uint32 uint64 uintptr
      int, uint, uintptr 在 32 位系统上是 32 位,在 64位 系统上是 64位
    • 浮点型:float32 float64
    • 复数型:complex64 complex128
  • 字符串
  • 布尔: true false

<font color=red >note</font>:在 if 语句中,若检验条件为 i >= 0,则 i 的类型不宜为 uint 型(uint 数据始终 >= 0)

操作符:

The Go Programming Language (Golang)
  • 取余 % 只用于整型;余数与被除数符号相同,5%3=2; -5%3=-2
  • 5.0/4=1.25;5/4.0=1.25;5/4=1
  • && 若左边的表达式结果为 false,不检验右边的表达式;& 始终检验两边的表达式
  • 与或 ^ ; 一元前缀 ^

聚集类型 (aggregate types):

1.数组

2.结构

引用类型

1.指针

2.切片、映射

3.函数

4.channel

接口类型:


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Weaving the Web

Weaving the Web

Tim Berners-Lee / Harper Paperbacks / 2000-11-01 / USD 15.00

Named one of the greatest minds of the 20th century by Time , Tim Berners-Lee is responsible for one of that century's most important advancements: the world wide web. Now, this low-profile genius-wh......一起来看看 《Weaving the Web》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

随机密码生成器
随机密码生成器

多种字符组合密码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码