Skip to content
This repository was archived by the owner on Jan 18, 2025. It is now read-only.
This repository was archived by the owner on Jan 18, 2025. It is now read-only.

Question: Expected a map got 'struct' #38

@josebalius

Description

@josebalius

So after bypassing the issues talked about on #29 and #37 I stopped using a custom type (for now) and was able to insert the struct without a problem, yay!

Now, I am trying to get it out, keep getting this error:

panic: 2 error(s) decoding:

* 'columns[0]' expected a map, got 'struct'
* 'source' expected a map, got 'struct'

The struct has a field called "columns" that holds a slice of "column" structs, and "source" is a struct as well. My question is how can I get it to be okay with it being a struct? Or does this mean that I should convert the whole struct to a map before inserting so that I can then pull it out later and do whatever conversions I need?

What I'm I doing wrong? Tried looking at the mapstructure documentation but couldn't find much.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions