|
You are here |
hjr265.me | ||
| | | | |
www.4async.com
|
|
| | | | | Go?1.17?1.17?1.18?6?Go 1.18?1.17? ?Go?interface{}?Go?interface{}? ?Go?... | |
| | | | |
blog.nuculabs.de
|
|
| | | | | Hi In this article I want to highlight a simple pattern for sorting a slice in Go on multiple keys. Given the following structure, let's say we want to sort it in ascending order after Version, Generation and Time. 1 2 3 4 5 type TheStruct struct { Generation int Time int Version int } The way we sort slices in Go is by using the sort interface or one of the sort.Slice functions. To sort the slice after the above criteria we'll call slice.Sort with the following function. | |
| | | | |
livesys.se
|
|
| | | | | ||
| | | | |
coredumped.dev
|
|
| | | Updated: 2023-01-06 About a year ago I was bitten by the PL bug. It started with reading Crafting Interpreters and discovering the wonders hidden under the hood of a compiler. I am also been a big fan of Emacs, and this started to get me interested in how its interpreter works. At the same time, I was reading the Rust book and trying to understand the concepts there. This all came to a head, and I decided to write an Emacs Lisp interpreter called rune in Rust. | ||