code: func (ss *FileSubStore) UpdateSub(sub *spb.SubState) error {
  	ss.Lock()
  	defer ss.Unlock()
  	if err := ss.writeRecord(nil, subRecUpdate, sub); err != nil {
  		return err
  	}
  	// We need to get a copy of the passed sub, we can't hold a reference
  	// to it.
  	csub := *sub
  	si := ss.subs[sub.ID]
  	if si != nil {
  		s := si.(*subscription)
  		s.sub = &csub
  	} else {
  		s := &subscription{sub: &csub, seqnos: make(map[uint64]struct{})}
  		ss.subs[sub.ID] = s
  	}
  	return nil
  }
docs: // UpdateSub updates a given subscription represented by SubState.