ZhangZhihui's Blog  
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 102 下一页

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. 阅读全文
posted @ 2024-06-11 20:02 ZhangZhihuiAAA 阅读(9) 评论(0) 推荐(0)
 
摘要: 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, 阅读全文
posted @ 2024-06-11 19:47 ZhangZhihuiAAA 阅读(11) 评论(0) 推荐(0)
 
摘要: 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 阅读全文
posted @ 2024-06-11 19:27 ZhangZhihuiAAA 阅读(17) 评论(0) 推荐(0)
 
摘要: package main import ( "fmt" "reflect" ) type Secret struct { Username string Password string } type Record struct { Field1 string Field2 float64 Field 阅读全文
posted @ 2024-06-11 17:07 ZhangZhihuiAAA 阅读(10) 评论(0) 推荐(0)
 
摘要: 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) == 阅读全文
posted @ 2024-06-11 11:35 ZhangZhihuiAAA 阅读(15) 评论(0) 推荐(0)
 
摘要: 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 阅读全文
posted @ 2024-06-11 11:22 ZhangZhihuiAAA 阅读(11) 评论(0) 推荐(0)
 
摘要: 阅读全文
posted @ 2024-06-11 10:12 ZhangZhihuiAAA 阅读(14) 评论(0) 推荐(0)

2024年6月10日

摘要: package main import ( "encoding/csv" "log" "os" ) type Record struct { Name string Surname string Number string LastAccess string } var myData = []Rec 阅读全文
posted @ 2024-06-10 20:58 ZhangZhihuiAAA 阅读(11) 评论(0) 推荐(0)
 
摘要: 阅读全文
posted @ 2024-06-10 20:16 ZhangZhihuiAAA 阅读(6) 评论(0) 推荐(0)
 
摘要: package main import ( crand "crypto/rand" "encoding/base64" "fmt" mrand "math/rand" "strings" ) const ( // As we only want to get printable ASCII char 阅读全文
posted @ 2024-06-10 17:40 ZhangZhihuiAAA 阅读(19) 评论(0) 推荐(0)
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 102 下一页