probo/pkg/models/question.go

20 lines
263 B
Go
Raw Normal View History

2022-06-23 11:25:35 +02:00
package models
2023-11-13 21:01:12 +01:00
import (
"crypto/sha256"
"fmt"
)
2022-06-23 11:25:35 +02:00
type Question struct {
2023-10-28 20:50:06 +02:00
Meta
Text string `json:"text"`
2022-06-23 11:25:35 +02:00
}
2023-11-13 21:01:12 +01:00
func (q *Question) String() string {
return q.Text
}
func (q *Question) GetHash() string {
return fmt.Sprintf("%x", sha256.Sum256([]byte(q.Text)))
}