undefined (cannot refer to unexported field or method)
<p>I'm trying to refer <code>Users struct</code> from the models package and trying to access the model from control.But I take following errors.</p>

<pre><code>controllers/user.go:87: user.create_date undefined (cannot refer to unexported field or method create_date)
controllers/user.go:88: user.update_date undefined (cannot refer to unexported field or method update_date)
controllers/user.go:104: user.user_id undefined (cannot refer to unexported field or method user_id)
controllers/user.go:119: user.update_date undefined (cannot refer to unexported field or method update_date)
controllers/user.go:136: user.user_id undefined (cannot refer to unexported field or method user_id)
controllers/user.go:151: user.update_date undefined (cannot refer to unexported field or method update_date)
controllers/user.go:166: user.user_id undefined (cannot refer to unexported field or method user_id)
</code></pre>

<p>Models.go</p>

<pre><code>package models


import(

    "time"
)

    type Users struct {

            user_id                                      int      `json:"user_id" form:"user_id" gorm:"column:user_id"`
            user_login                                   string   `json:"user_login" form:"user_login" gorm:"column:user_login"` 
            user_email                                   string   `json:"user_email" form:"user_email" gorm:"column:user_email"` 
            user_password                                string   `json:"user_password" form:"user_password" gorm:"column:user_password"` 
            user_password_salt                           string   `json:"user_password_salt" form:"user_password_salt" gorm:"column:user_password_salt"` 
            user_2factor_secret                          string   `json:"user_2factor_secret" form:"user_2factor_secret" gorm:"column:user_2factor_secret"`
            user_fullname                                string   `json:"user_fullname" form:"user_fullname" gorm:"column:user_fullname"`
            user_description                             string   `json:"user_description" form:"user_description" gorm:"column:user_description"`
            user_enabled                                 string   `json:"user_enabled" form:"user_enabled" gorm:"column:user_enabled"`
            user_verified                                string   `json:"user_verified" form:"user_verified" gorm:"column:user_verified"`
            PublisherInfoID                              int      `json:"PublisherInfoID" form:"PublisherInfoID" gorm:"column:PublisherInfoID"`
            DemandCustomerInfoID                         int      `json:"DemandCustomerInfoID" form:"DemandCustomerInfoID" gorm:"column:DemandCustomerInfoID"`
            create_date                                  time.Time `json:"create_date" gorm:"column:create_date"`
            update_date                                  time.Time  `json:"update_date" gorm:"column:update_date"` 
            user_permission_cache                        string   `json:"user_permission_cache" form:"user_permission_cache" gorm:"column:user_permission_cache"`
            user_role                                    int      `json:"user_role" form:"user_role" gorm:"column:user_role"`

        }
</code></pre>

<p>in controllers</p>

<pre><code>   package controllers

    import (
        "time"

      "github.com/op/go-logging"
        "github.com/gin-gonic/gin"
        "github.com/jinzhu/gorm"
      _ "github.com/go-sql-driver/mysql"

        "../models"
    )

    var loguser = logging.MustGetLogger("AdsAPI")

    type AdsControllerUser struct {
        DB gorm.DB
    }

    func (ac *AdsControllerUser) SetDB(d gorm.DB) {
        ac.DB = d
        ac.DB.LogMode(true)
    }
    func (ac *AdsControllerUser) CreateUsers(c *gin.Context) {

      var user models.Users

      // This will infer what binder to use depending on the content-type header.
      c.Bind(&amp;user)

        // Update Timestamps
        user.create_date = time.Now()
        user.update_date = time.Now()

        err := ac.DB.Save(&amp;user)
        if err != nil {
            loguser.Debugf("Error while creating a user, the error is '%v'", err)
            res := gin.H{
                    "status": "403",
                    "error": "Unable to create user",
            }
            c.JSON(404, res)
            return
        }

        content := gin.H{
                "status": "201",
                "result": "Success",
                "UserID": user.user_id,
            }

      c.Writer.Header().Set("Content-Type", "application/json")
      c.JSON(201, content)
    }

func (ac *AdsControllerUser) UpdateUsers(c *gin.Context) {
    // Grab id
    id := c.Params.ByName("id")
  var user models.Users

  c.Bind(&amp;user)

    // Update Timestamps
    user.update_date = time.Now()

    //err := ac.DB.Model(&amp;models.auth_User).Where("user_id = ?", id).Updates(&amp;cm)
    err := ac.DB.Where("user_id = ?", id).Updates(&amp;user)
    if err != nil {
        loguser.Debugf("Error while updating a user, the error is '%v'", err)
        res := gin.H{
                "status": "403",
                "error": "Unable to update user",
        }
        c.JSON(403, res)
        return
    }

    content := gin.H{
            "status": "201",
            "result": "Success",
            "UserID": user.user_id,
        }

    c.Writer.Header().Set("Content-Type", "application/json")
    c.JSON(201, content)
}

func (ac *AdsControllerUser) DeleteUsers(c *gin.Context) {
    // Grab id
    id := c.Params.ByName("id")
  var user models.Users

  c.Bind(&amp;user)

    // Update Timestamps
    user.update_date = time.Now()

    err := ac.DB.Where("user_id = ?", id).Delete(&amp;user)
    if err != nil {
        loguser.Debugf("Error while deleting a user, the error is '%v'", err)
        res := gin.H{
                "status": "403",
                "error": "Unable to delete user",
        }
        c.JSON(403, res)
        return
    }

    content := gin.H {
            "result": "Success",
            "UserID": user.user_id,
        }

  c.Writer.Header().Set("Content-Type", "application/json")
  c.JSON(201, content)
}
</code></pre>