func (o Obj) Worker(lp string) {
for {
select {
case <-o.doneChan:
return nil
case m := <-o.inChan:
if e := o.do(logPrefix, m); e != nil {
o.errChan <- e
}
}
}
type SurveyShow struct {
ID string `json:"survey_id"`
Name string `json:"survey_name"`
Description *string `json:"survey_description"`
StartPeriod *string `json:"start_period"`
EndPeriod *string `json:"end_period"`
}
func prepareShow(in *Survery) *SurveryShow {
var ret = SurveryShow{ ID: in.IN, Name: in.Name}
if in.Description.Valid {
ret.Description = &in.Description.Value
}
...
return &ret
}