package server import ( "net/http" "pageswiki/internal/store" ) func (s *Server) currentDistrict() *store.District { sp, err := s.store.GetDefaultDistrict() if err != nil { return &store.District{ ID: 1, Name: "default", Title: "Default District", Enabled: true, } } return sp } func (s *Server) districtForRequest( r *http.Request, ) *store.District { if r == nil { return s.currentDistrict() } sp, err := s.store.GetDistrictByHost( r.Host, ) if err != nil { return s.currentDistrict() } return sp }