Skip to content

What struct to give query for a single value #450

Closed Answered by slugger7
slugger7 asked this question in Q&A
Discussion options

You must be logged in to vote

var dest struct{model.Entity} does work (still could not find the documentation about this though. I was just forgetting to pass it by reference to query

It does fail if there are no rows in the result though which is annoying. It does not just set the value in the struct to nil

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by slugger7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant