{ "Implement a sortable type in go": { "prefix": "sortable", "body": [ "// ${1:SortableList} implements sort.Interface for []${2:SortableType} based on", "// the ${3:FieldName} field.", "type ${1:SortableList} []${2:SortableType}", "func (a ${1:SortableList}) Len() int { return len(a) }", "func (a ${1:SortableList}) Swap(i, j int) { a[i], a[j] = a[j], a[i] }", "func (a ${1:SortableList}) Less(i, j int) bool { return a[i].${3:FieldName} < a[j].${3:FieldName} }" ], "description": "Implement a sortable type in go" }