I have a function that creates an order
.
I need to know the Ogrn
field is null or not. How should I do it?
Func:
func CreateOrder(c *gin.Context) {
var order models.Order
var form models.Form
if &form.Ogrn == nil {
...
} else {
...
}
c.JSON(http.StatusOK, gin.H{
...})
}
Struct:
type Form struct {
gorm.Model
...
Ogrn string `json:"ogrn"`
...
}