code: func unmarshal(
  	c context.Context, msg []byte) ([]*buildbot.Build, *buildbot.Master, error) {
  	bm := buildMasterMsg{}
  	if len(msg) == 0 {
  		return bm.Builds, bm.Master, nil
  	}
  	reader, err := zlib.NewReader(bytes.NewReader(msg))
  	if err != nil {
  		logging.WithError(err).Errorf(c, "gzip decompression error")
  		return nil, nil, err
  	}
  	defer reader.Close()
  	d := json.NewDecoder(reader)
  	if err = d.Decode(&bm); err != nil {
  		logging.WithError(err).Errorf(c, "could not unmarshal message")
  		return nil, nil, err
  	}
  	// Extract the builds out of master and append it onto builds.
  	if bm.Master != nil {
  		for _, slave := range bm.Master.Slaves {
  			if slave.RunningbuildsMap == nil {
  				slave.RunningbuildsMap = map[string][]int{}
  			}
  			for _, build := range slave.Runningbuilds {
  				build.Master = bm.Master.Name
  				bm.Builds = append(bm.Builds, build)
  				slave.RunningbuildsMap[build.Buildername] = append(
  					slave.RunningbuildsMap[build.Buildername], build.Number)
  			}
  			slave.Runningbuilds = nil
  		}
  	}
  	return bm.Builds, bm.Master, nil
  }
docs: // unmarshal a gzipped byte stream into a list of buildbot builds and masters.