code: func (c *EtcdLockClient) Set(sem *Semaphore) error {
  	if sem == nil {
  		return errors.New("cannot set nil semaphore")
  	}
  	b, err := json.Marshal(sem)
  	if err != nil {
  		return err
  	}
  
  	setopts := &client.SetOptions{
  		PrevIndex: sem.Index,
  	}
  
  	_, err = c.keyapi.Set(context.Background(), c.keypath, string(b), setopts)
  	return err
  }
docs: // Set sets a Semaphore in etcd.