package models type Role struct { Id int `json:"id"` Role string `json:"role"` Rights []Rights `json:"rights"` } func (r *Role) IsValid() bool { return r.Role != "" }