ZhangZhihui's Blog |
|
||
2024年6月11日
摘要:
package main import ( "database/sql" "fmt" "os" _ "github.com/mattn/go-sqlite3" ) func main() { // Connect or create a SQLite database db, err := sql. 阅读全文
摘要:
If there are multiple init() functions in a package, don't use in an init() function a global variable that is initialized in another init() function, 阅读全文
摘要:
Remember that the biggest advantage you get from using a map[string]interface{} map, or any map that stores an interface{} value in general, is that y 阅读全文
摘要:
package main import ( "fmt" "reflect" ) type Secret struct { Username string Password string } type Record struct { Field1 string Field2 float64 Field 阅读全文
摘要:
package main import ( "fmt" "maps" ) func delete(k string, v int) bool { return v%2 != 0 } func equal(v1 int, v2 float64) bool { return float64(v1) == 阅读全文
摘要:
package main import ( "fmt" "slices" ) func main() { s1 := []int{1, 2, -1, -2} s2 := slices.Clone(s1) fmt.Printf("%p\n", s1) fmt.Printf("%p\n", s2) s1 阅读全文
摘要:
阅读全文
|
Copyright © 2024 ZhangZhihuiAAA
Powered by .NET 9.0 on Kubernetes |