package models import ( "crypto/sha256" "fmt" ) type Question struct { Meta Text string `json:"text"` } func (q *Question) String() string { return q.Text } func (q *Question) GetID() string { return q.ID } func (q *Question) SetID(id string) { q.ID = id } func (q *Question) GetHash() string { return fmt.Sprintf("%x", sha256.Sum256([]byte(q.Text))) }