Compare commits
8 Commits
7272017f7d
...
2a5a23bffd
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a5a23bffd | |||
| a81d851ec8 | |||
| 97e657f4ad | |||
| ebd098db4d | |||
| 4bb84a9f4c | |||
| ab888e6be4 | |||
| 02b69b2e5a | |||
| 4418c9a1b5 |
6
.gitlab-ci.yml
Normal file
6
.gitlab-ci.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
build_job:
|
||||
stage: build
|
||||
script:
|
||||
- echo "仅build分支执行CI流水线"
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == "build"'
|
||||
37
4.基本数据类型.go
Normal file
37
4.基本数据类型.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
type_()
|
||||
|
||||
}
|
||||
|
||||
func type_() {
|
||||
var age int = 12 // 设定类型为数字
|
||||
fmt.Println(age)
|
||||
|
||||
var text = "Hello mfk\n" // 自动识别类型
|
||||
fmt.Printf(text)
|
||||
|
||||
// uint + x
|
||||
// x 是比特的位数
|
||||
var u8 uint8 = 255
|
||||
// 0 0 0 0 0 0 0 0 = 0
|
||||
// 1 1 1 1 1 1 1 1 = 2^8-1=255
|
||||
fmt.Println(u8)
|
||||
// int8 支持正负数
|
||||
// 0 0 0 0 0 0 0 0 = 1
|
||||
// 0 1 1 1 1 1 1 1 = 2^(8-1)-1=127 // 一个比特位区分正负了
|
||||
|
||||
// 1 0 0 0 0 0 0 1 = -1 负数的最大值
|
||||
// 1 0 0 0 0 0 0 0 = -128
|
||||
|
||||
//######################################################
|
||||
// 源码 补码 (取反=反码+1)听不懂,标记一下,下次学
|
||||
//######################################################
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user