初始化

This commit is contained in:
2025-04-08 17:01:19 +08:00
commit 4228f447f7
75 changed files with 574 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package main
import "fmt"
func main() {
// 基本指针操作
a := 42
p := &a // 获取a的地址
fmt.Printf("a的值: %d, 地址: %p\n", a, p)
fmt.Printf("通过指针访问值: %d\n", *p)
// 通过指针修改值
*p = 100
fmt.Printf("修改后a的值: %d\n", a)
// 指针的指针
pp := &p
fmt.Printf("指针的指针: %p\n", pp)
fmt.Printf("通过指针的指针访问值: %d\n", **pp)
}

View File

@@ -0,0 +1,3 @@
module structs
go 1.21

View File

@@ -0,0 +1,5 @@
package main
func main() {
// TODO
}

View File

@@ -0,0 +1,3 @@
module interfaces
go 1.21

View File

@@ -0,0 +1,5 @@
package main
func main() {
// TODO
}

View File

@@ -0,0 +1,3 @@
module error_handling
go 1.21

View File

@@ -0,0 +1,5 @@
package main
func main() {
// TODO
}

View File

@@ -0,0 +1,3 @@
module goroutines
go 1.21

View File

@@ -0,0 +1,5 @@
package main
func main() {
// TODO
}

View File

@@ -0,0 +1,3 @@
module channels
go 1.21

View File

@@ -0,0 +1,5 @@
package main
func main() {
// TODO
}

View File

@@ -0,0 +1,3 @@
module sync_pkg
go 1.21

View File

@@ -0,0 +1,5 @@
package main
func main() {
// TODO
}