I have a table contains column created_at
I need to compare the time in this column with the now time for example:
result := database.DB.Where("code = ?", post.code).First(&post)
if result.CreatedAt < time.Now() {
// do something
}
I got error in my editor: Invalid operation: result.CreatedAt > time.Now() (the operator > is not defined on Time)
How can check if the date expires?