gerben.dev

In reply to: https://hachyderm.io/@anderseknert/113826582394790857

Oh nice indeed.

I went to check the docs and they have an even more intricate example with multiple checks https://pkg.go.dev/cmp#example-Or-Sort

	slices.SortFunc(orders, func(a, b Order) int {
		return cmp.Or(
			strings.Compare(a.Customer, b.Customer),
			strings.Compare(a.Product, b.Product),
			cmp.Compare(b.Price, a.Price),
		)
	})

Leave a note

This website uses WebMentions and ActivityPub (via brid.gy), you can respond to this post by linking from your page or replying directly to the Fediverse post.

WebMention

or manually.

Fediverse

On the Fediverse or BlueSky you can search for the URL https://gerben.dev/replies/afa5c123e71f7a751b2751ee5105c5a0 or search for my handle @gerben.dev@gerben.dev.

View source

✨ It's dangerous out there, please take some space dust! ✨
This work is licensed under CC BY-NC-SA 4.0 | πŸ€– No AI | πŸ“Š Uptime Status