I started Go very recently and decided to create a simple CRUD back-end using gorm
and gin
.I have implemented the following function to retrieve a query result.
I can't get some of the endpoints to work.
func GetCurrentStock(c *gin.Context) {
result := initializers.DB.Table("dev.inventory_live").Debug().Select("sum(qtynos)").Where("NOT is_cut AND (remarks IS NULL OR remarks = '')")
c.JSON(http.StatusOK, gin.H{
"result": result,
})
}
When I send a request to the end point, I keep getting this error
Error #01: json: unsupported type: func() time.Time
Is there something I am missing? I haven't been able to find a solution