code: func (ch *CRLChecker) refetchShard(c context.Context, idx int, prevState shardCache) (newState shardCache, err error) {
  	// Have something locally already? Quickly fetch CRLShardHeader to check
  	// whether we need to pull a heavy CRLShardBody.
  	hdr := CRLShardHeader{ID: shardEntityID(ch.cn, ch.shardCount, idx)}
  	if prevState.sha1 != "" {
  		switch err = ds.Get(c, &hdr); {
  		case err == ds.ErrNoSuchEntity:
  			err = fmt.Errorf("shard header %q is missing", hdr.ID)
  			return
  		case err != nil:
  			err = transient.Tag.Apply(err)
  			return
  		}
  		// The currently cached copy is still good enough?
  		if hdr.SHA1 == prevState.sha1 {
  			newState = prevState
  			return
  		}
  	}
  
  	// Nothing is cached, or the datastore copy is fresher than what we have in
  	// the cache. Need to fetch a new copy, unzip and deserialize it. This entity
  	// is prepared by updateCRLShard.
  	body := CRLShardBody{Parent: ds.KeyForObj(c, &hdr)}
  	switch err = ds.Get(c, &body); {
  	case err == ds.ErrNoSuchEntity:
  		err = fmt.Errorf("shard body %q is missing", hdr.ID)
  		return
  	case err != nil:
  		err = transient.Tag.Apply(err)
  		return
  	}
  
  	// Unzip and deserialize.
  	blob, err := utils.ZlibDecompress(body.ZippedData)
  	if err != nil {
  		return
  	}
  	shard, err := shards.ParseShard(blob)
  	if err != nil {
  		return
  	}
  
  	newState = shardCache{shard: shard, sha1: body.SHA1}
  	return
  }
docs: // refetchShard is called by 'shard' to fetch a new version of a shard.