Skip to content
Josh Bleecher Snyder edited this page Aug 12, 2023 · 5 revisions

This page is about Go-related Cursorless tips and quirks. It will eventually be subsumed by a Go docs page.

For the most part, Go is like any other Cursorless-supported language, and the first port of call is the main Cursorless documentation.

Scopes

Maps and lists

Cursorless considers any composite literal that contains any indexed element to be a map. That includes maps (map[string]int{"a": 2}, structs using field names (T{a: 2}), and arrays and structs with numeric indices ([256]bool{58: true}). It also includes {}.

Similarly, Cursorless considers any composite literal that contains any non-indexed element to be a list. That includes slices and arrays ([]int{2} and structs not using field names (T{2}). It also includes {}.

For more on the rationale, see:

https://github.com/cursorless-dev/cursorless/blob/4588044dcc0d73d5507ff0cbf1dcd2ea988ffd6b/queries/go.scm#L39-L78

Clone this wiki locally