probo/pkg/models/question.go

19 lines
263 B
Go

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) GetHash() string {
return fmt.Sprintf("%x", sha256.Sum256([]byte(q.Text)))
}