Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
Go Fundamentals: Types, Zero Values, Slices, Maps, Pointers and Control Flow
In Go a slice is a small header made of a pointer, len and cap, and sub-slices share the same backing array, which is why a filter working on books[:0] corrupts the original catalog. The zero value philosophy, constants with iota, strings vs bytes vs runes and the len trap with Turkish characters, append growing capacity, nil maps and random map order, pointers and Go 1.26's new(expr), the 1.22 loop variable and nil slices turning into null in JSON.
The slices, maps, sort and cmp Packages in Go: Sorting, Searching, Grouping and Collection Work with Iterators
In Go, multi-field sorting combines slices.SortStableFunc with cmp.Or and cmp.Compare; map iteration order changes on every run, and sorted keys need slices.Sorted(maps.Keys(m)). Adding ?sort= and a category summary to Bookstore, LINQ counterparts, backing-array traps with append and slices.Delete, json/v2 map order, measuring sort against slices, and Turkish sorting with x/text/collate.