Reihenfolge innerhalb aller structs so verändert, dass möglichst wenige Pointerbytes verwendet werden.

This commit is contained in:
Jason Streifling 2024-01-06 16:18:19 +01:00
parent 66f7179267
commit b4d453b108
4 changed files with 13 additions and 13 deletions

View File

@ -18,38 +18,38 @@ type DB struct {
}
type Person struct {
ID int64
FirstName string
LastName string
ID int64
}
type Instructor Person
type Participant struct {
Person
Company string
Person
}
type Briefing struct {
ID int64
DateTime string
Location string
Document string
AsOf string
InstructorID int64
ID int64
}
type Answer struct {
ID int64
Text string
IsImage bool // TODO: relocate to sessionStructs if possible
ID int64
}
type Question struct {
ID int64
Text string
Answers []Answer
Correct int
ID int64
}
type GivenAnswer struct {

View File

@ -26,9 +26,9 @@ import (
type briefing struct {
*data.Briefing
uuid uuid.UUID
participants []*participant
questions []data.Question
uuid uuid.UUID
}
func generateLogin() (string, error) {

View File

@ -17,27 +17,27 @@ import (
)
type tableHTMLData struct {
sessionID uuid.UUID
otd []data.OverviewTableData
sessionID uuid.UUID
}
type participantHTMLData struct {
briefingID uuid.UUID
participant
briefingID uuid.UUID
}
type questionHTMLData struct {
question data.Question
participantHTMLData
questionID int64
question data.Question
}
type resultAnswer struct {
id int64
text string
correct bool
chosen bool
isImage bool // TODO: relocate to sessionStructs if possible
id int64
}
type resultQuestion struct {
@ -46,12 +46,12 @@ type resultQuestion struct {
}
type resultHTMLData struct {
participantHTMLData
questions []resultQuestion
participantHTMLData
}
type summaryHTMLData struct {
participantsData []participantHTMLData
sessionID uuid.UUID
briefingID uuid.UUID
participantsData []participantHTMLData
}

View File

@ -21,9 +21,9 @@ import (
)
type Session struct {
uuid uuid.UUID
instructor data.Instructor
briefings []*briefing
uuid uuid.UUID
}
func (s *Session) handleSearch(db *data.DB) http.HandlerFunc {