We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
type Company struct { Id string db:"id" form:"id" json:"id" ComDesc string db:"com_desc,omitempty" form:"com_desc" json:"com_desc" ComName string db:"com_name" form:"com_name" json:"com_name" }
db:"id" form:"id" json:"id"
db:"com_desc,omitempty" form:"com_desc" json:"com_desc"
db:"com_name" form:"com_name" json:"com_name"
i use the omitempty tag ,that is not work
The text was updated successfully, but these errors were encountered:
Please consider asking questions on Stack Overflow.
Sorry, something went wrong.
Or Golang Slack.
Either make sure the query doesn't return rows with com_desc = null or make use of sql.NullString like so:
com_desc
null
sql.NullString
type Company struct { Id string `db:"id" form:"id" json:"id"` ComDesc sql.NullString `db:"com_desc,omitempty" form:"com_desc" json:"com_desc"` ComName string `db:"com_name" form:"com_name" json:"com_name"` }
No branches or pull requests
type Company struct {
Id string
db:"id" form:"id" json:"id"
ComDesc string
db:"com_desc,omitempty" form:"com_desc" json:"com_desc"
ComName string
db:"com_name" form:"com_name" json:"com_name"
}
i use the omitempty tag ,that is not work
The text was updated successfully, but these errors were encountered: