code: func (s *Semaphore) encodeLock(l *semaphoreLock, oldIndex uint64) (*KVPair, error) {
  	enc, err := json.Marshal(l)
  	if err != nil {
  		return nil, fmt.Errorf("lock encoding failed: %v", err)
  	}
  	pair := &KVPair{
  		Key:         path.Join(s.opts.Prefix, DefaultSemaphoreKey),
  		Value:       enc,
  		Flags:       SemaphoreFlagValue,
  		ModifyIndex: oldIndex,
  	}
  	return pair, nil
  }
docs: // encodeLock is used to encode a semaphoreLock into a KVPair
  // that can be PUT