上一页 1 ··· 52 53 54 55 56 57 58 59 60 ··· 494 下一页
摘要: 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 阅读(13) 评论(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 阅读(27) 评论(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 阅读(14) 评论(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 阅读(11) 评论(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 阅读(27) 评论(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 阅读(100) 评论(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 阅读(37) 评论(0) 推荐(0)
摘要: type AnyProppertyKey = keyof any Example: type Example = Record<AnyProertyKey, any> 阅读全文
posted @ 2024-01-31 15:10 Zhentiw 阅读(9) 评论(0) 推荐(0)
摘要: Since typescript 5, we are able to add constraints over infer. Following code doesn't apply constraints, so the inferred element could be stringand nu 阅读全文
posted @ 2024-01-29 23:44 Zhentiw 阅读(16) 评论(0) 推荐(0)
摘要: type OneArgFn<A = any> = (firstArg: A, ..._args: any[]) => void type GetFirstArg<T> = T extends OneArgFn<infer R> ? R : never; // Test case function f 阅读全文
posted @ 2024-01-29 23:39 Zhentiw 阅读(7) 评论(0) 推荐(0)
上一页 1 ··· 52 53 54 55 56 57 58 59 60 ··· 494 下一页