From 66f71792673ba2e8a470c45374c13fabf117c7be Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Sat, 6 Jan 2024 16:16:07 +0100 Subject: [PATCH] type mux ist jetzt privat --- packages/server/mux.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/server/mux.go b/packages/server/mux.go index 19addf5..8a8c806 100644 --- a/packages/server/mux.go +++ b/packages/server/mux.go @@ -20,12 +20,12 @@ import ( "streifling.com/jason/sicherheitsunterweisung/packages/data" ) -type Mux struct { +type mux struct { *http.ServeMux } -func NewMux() *Mux { - return &Mux{ServeMux: http.NewServeMux()} +func NewMux() *mux { + return &mux{ServeMux: http.NewServeMux()} } func getQuestions(db *data.DB, b *briefing) { @@ -53,7 +53,7 @@ func getQuestions(db *data.DB, b *briefing) { } } -func (mux *Mux) handleParticipants(db *data.DB, cp <-chan *participant, b *briefing) { +func (mux *mux) handleParticipants(db *data.DB, cp <-chan *participant, b *briefing) { for p := range cp { p.givenAnswers = make([]int, len(b.questions)) @@ -69,7 +69,7 @@ func (mux *Mux) handleParticipants(db *data.DB, cp <-chan *participant, b *brief } } -func (mux *Mux) handleBriefings(db *data.DB, cb <-chan *briefing, s *Session) { +func (mux *mux) handleBriefings(db *data.DB, cb <-chan *briefing, s *Session) { participantChan := make(chan *participant) for b := range cb { getQuestions(db, b) @@ -81,7 +81,7 @@ func (mux *Mux) handleBriefings(db *data.DB, cb <-chan *briefing, s *Session) { } } -func (mux *Mux) HandleSessions(db *data.DB, cs <-chan *Session, ss *[]*Session) { +func (mux *mux) HandleSessions(db *data.DB, cs <-chan *Session, ss *[]*Session) { briefingChan := make(chan *briefing) for s := range cs { (*ss) = append((*ss), s)