Code-Memo

Joining a slice of strings

Use strings.Join with a separator — O(n) over total length with one allocation when sizes are known (builder path inside Join).

parts := []string{"a", "b", "c"}
s := strings.Join(parts, ",") // "a,b,c"
Empty separator
s := strings.Join(parts, "") // concatenation
From integers

Convert first:

nums := []int{1, 2, 3}
strs := make([]string, len(nums))
for i, n := range nums {
	strs[i] = strconv.Itoa(n)
}
out := strings.Join(strs, " ")
strings.Builder for custom separators

When logic is not a simple delimiter, loop with WriteString or fmt.Fprintf into a Builder.

CSV and escaping

For CSV output, use encoding/csv rather than manual Join when fields may contain commas or quotes.