Skip to content

Collections

Targo gives you two collection styles:

  • Go-native collections such as slice<T>, map<K, V>, Fixed<T, N>, and chan<T>
  • runtime-backed collections such as Array<T>

Choose first, then code

Prefer slice<T> when

  • you are writing core logic
  • you want Go-native semantics
  • you care about low-overhead Go interop

Prefer Array<T> when

  • you explicitly want push, map, filter, or reduce
  • you are preserving a JS-style collection workflow on purpose

Remember

  • map<K, V> is the Targo map type, not JS Map
  • chan<T> is a Go concurrency channel, not a Promise abstraction