Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot unmarshal object into Go struct field Board.panels of type string #189

Open
kitianFresh opened this issue Jan 18, 2022 · 4 comments

Comments

@kitianFresh
Copy link

func (m *manager) DashboardPanels(ctx context.Context, uid string) ([]*grafanasdk.Panel, error) {
	board, _, err := m.grafanaClient.GetDashboardByUID(ctx, uid)
	if err != nil {
		return nil, err
	}
	return board.Panels, nil
}

So strange, i have checked my dashboard json file, the panels field, it is an array not a string

@kitianFresh
Copy link
Author

@Yasumoto

@csmarchbanks
Copy link
Contributor

Would you try #190? I was running into this error and think that it is fixed by the datasource change, even though the error is very confusing.

Go mod replace:

replace github.com/grafana-tools/sdk => github.com/csmarchbanks/sdk v0.0.0-20220120205302-870d00a83f4e

@Noksa
Copy link

Noksa commented Jan 27, 2022

@csmarchbanks
Thanks, it works!

@GiedriusS
Copy link
Collaborator

#190 (comment) see my comment here. What do you think? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants