mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix hmm... another stupid mistake
This commit is contained in:
parent
28722e2127
commit
4479d72e93
@ -1,6 +1,7 @@
|
|||||||
package v1
|
package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
etcdErr "github.com/coreos/etcd/error"
|
etcdErr "github.com/coreos/etcd/error"
|
||||||
@ -31,7 +32,7 @@ func SetKeyHandler(w http.ResponseWriter, req *http.Request, s Server) error {
|
|||||||
// If the "prevValue" is specified then test-and-set. Otherwise create a new key.
|
// If the "prevValue" is specified then test-and-set. Otherwise create a new key.
|
||||||
var c raft.Command
|
var c raft.Command
|
||||||
if prevValueArr, ok := req.Form["prevValue"]; ok {
|
if prevValueArr, ok := req.Form["prevValue"]; ok {
|
||||||
if len(prevValueArr) > 0 { // test against previous value
|
if len(prevValueArr[0]) > 0 { // test against previous value
|
||||||
c = &store.CompareAndSwapCommand{
|
c = &store.CompareAndSwapCommand{
|
||||||
Key: key,
|
Key: key,
|
||||||
Value: value,
|
Value: value,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user