notexOPENOverview
Notex/Languages/Code Review: Strings and Maps
01.28LESSON 28 OF 33 · 1 MIN READ

Code Review: Strings and Maps

Always free to read
  • Don’t slice or index a string unless you know it’s single-byte content.

  • Never convert an int to string with string(x).

  • Always initialize maps before writing.

  • Use the comma-ok idiom whenever a map’s zero value is a legitimate value.

  • Check the slices, bytes, and maps packages before writing your own helper.

Progress is saved on this device.
KEEP EXPLORING

One note leads to another.

Back to the library →
⌕
Search across the entire library ⌘ K