上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 499 下一页
摘要: Hello World Let's create a simple Go server, first let's setup the server and do hello world // @filename: main.go package main import ( "fmt" "net/ht 阅读全文
posted @ 2024-02-09 15:58 Zhentiw 阅读(33) 评论(0) 推荐(0)
摘要: Vanilla Go includes Testing A test is a file with suffix_test.go You define functions with prefix Test and with an special signature receiving a *test 阅读全文
posted @ 2024-02-06 22:16 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要: So, let's say we have a function to fetch crypto currencies price: package main import ( "fmt" "sync" "project/api" ) func main() { go getCurrencyData 阅读全文
posted @ 2024-02-06 22:03 Zhentiw 阅读(29) 评论(0) 推荐(0)
摘要: A goroutine is the Go way of suing threads, we open a goroutine just by invoking any function with a go prefix. go functionCall() Goroutines can commu 阅读全文
posted @ 2024-02-06 16:16 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: Go has a special indexing syntax that forms the basis of removing one or more elements from a slice. I will teach you this syntax and show you its var 阅读全文
posted @ 2024-02-06 03:40 Zhentiw 阅读(42) 评论(0) 推荐(0)
摘要: Panic recovery is a mechanism in Go that allows a program to handle unexpected errors (panics) gracefully. package main import ( "fmt" ) func mayPanic 阅读全文
posted @ 2024-02-06 03:24 Zhentiw 阅读(21) 评论(0) 推荐(0)
摘要: defermake sure the operation will be executed at the end of a function. func loadChampions() ([]champion, error) { file, err := os.Open("tft_champions 阅读全文
posted @ 2024-02-06 03:22 Zhentiw 阅读(23) 评论(0) 推荐(0)
摘要: A memory pool, also known as a memory buffer pool, is a method used in software development for managing memory allocation. Instead of allocating and 阅读全文
posted @ 2024-02-05 16:00 Zhentiw 阅读(46) 评论(0) 推荐(0)
摘要: Covariance - producer - out - function return position - same arrow direction Contravariance - packager - in - function param position - different arr 阅读全文
posted @ 2024-02-01 16:03 Zhentiw 阅读(140) 评论(0) 推荐(0)
摘要: Our project might have a file structure like Our project might have a file structure like data/ book.ts // A model for Book records magazine.ts // A m 阅读全文
posted @ 2024-01-31 16:02 Zhentiw 阅读(62) 评论(0) 推荐(0)
上一页 1 ··· 57 58 59 60 61 62 63 64 65 ··· 499 下一页