Reading data from index selection in golang

Hi

I’m kind of lost in my attempt to read data from an index, using a map.

The implementation is on golang and I’m failing to successfully read data from the returned set into native go structure.

The code snippet where the records are extracted is like follows:

	result, err := fc.Query(
		f.Map(
			f.Paginate(f.MatchTerm(
				f.Index("BaseItems_by_base_and_key"),
				f.Arr{baseIndex, itemKey})),
			f.Lambda(
				f.Arr{"id", "code", "desc", "price", "category"},
				f.Obj{
					"id":       f.Var("id"),
					"code":     f.Var("code"),
					"desc":     f.Var("desc"),
					"price":    f.Var("price"),
					"category": f.Var("category"),
				},
			),
		),
	)

This works well an outputs:

result = map[data:[map[category:CANOPY code:CPT_CAN_SC_OS desc:Canopy Single Cab Oversized id:130 price:30521.39]]]

But I cannot seem to be able to convert the JSON object into a native go structure.

Extracting individual elements with the At() function works, but since the data is in a structure already, a simple convert into a struct should be easy. But alas, the solution escapes me.

Any help will be appreciated.

Regards