|
You are here |
dolthub.com | ||
| | | | |
www.sethvargo.com
|
|
| | | | | Go 1.21 has some awesome new functionality that improves the developer experience and performance. | |
| | | | |
antonz.org
|
|
| | | | | Computing the smallest/largest value and clearing containers. | |
| | | | |
hjr265.me
|
|
| | | | | I wanted to list all the time zones in Go. The standard library in Go comes with the time package. It also comes with the time/tzdata package. The standard time package in Go is very well-thought-out. It makes date-time manipulation deceptively simple. Yet, I could not find a way to list all the time zones. Time Zone Database The documentation for time.LoadLocation describes how Go uses four sources of time zone data: | |
| | | | |
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. | ||