上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 494 下一页
摘要: Golang has no built-in function(s) to filter an array. This lesson will teach you two different ways to filter. The first is to create a separate arra 阅读全文
posted @ 2024-02-18 04:05 Zhentiw 阅读(35) 评论(0) 推荐(0)
摘要: There are numerous ways that you can declare and create arrays and slices in Go. This lesson will show you several and I talk about the advantages and 阅读全文
posted @ 2024-02-18 03:58 Zhentiw 阅读(19) 评论(0) 推荐(0)
摘要: In Rust, the exclamation mark (!) after a name indicates that it is a macro rather than a function. Macros and functions in Rust are called differentl 阅读全文
posted @ 2024-02-15 16:11 Zhentiw 阅读(24) 评论(0) 推荐(0)
摘要: We can use Reusltenum to do error handling type Result<V, E> { Err(E), Ok(V) } Example: // (): empty // uszie: just return a integre as error for demo 阅读全文
posted @ 2024-02-15 16:09 Zhentiw 阅读(14) 评论(0) 推荐(0)
摘要: pub enum Option2<T> { None, Some(T) } /** impl is similar to typescript a class with is_some method */ impl<T> Option2<T> { pub fn is_some(&self) -> b 阅读全文
posted @ 2024-02-13 16:04 Zhentiw 阅读(12) 评论(0) 推荐(0)
摘要: Go Enum package main type GoEnum = int const ( Foo GoEnum = iota Bar Baz ) func main() { } Typescript Enum enum TsEnum { Foo, Bar, Baz } Rust Enum enu 阅读全文
posted @ 2024-02-12 16:04 Zhentiw 阅读(18) 评论(0) 推荐(0)
摘要: Converts an observable to a promise by subscribing to the observable, and returning a promise that will resolve as soon as the first value arrives fro 阅读全文
posted @ 2024-02-11 22:00 Zhentiw 阅读(186) 评论(0) 推荐(0)
摘要: 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 阅读(20) 评论(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 阅读(9) 评论(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 阅读(12) 评论(0) 推荐(0)
上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 494 下一页