Skip to content

Commit

Permalink
gofmt and revice test case of sequence ttl node
Browse files Browse the repository at this point in the history
  • Loading branch information
einxie authored and pmazzini committed Jun 11, 2020
1 parent d716890 commit 74fff30
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 45 deletions.
84 changes: 42 additions & 42 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ const (
)

const (
opNotify = 0
opCreate = 1
opDelete = 2
opExists = 3
opGetData = 4
opSetData = 5
opGetAcl = 6
opSetAcl = 7
opGetChildren = 8
opSync = 9
opPing = 11
opGetChildren2 = 12
opCheck = 13
opMulti = 14
opReconfig = 16
opCreateContainer = 19
opCreateTTL = 21
opClose = -11
opSetAuth = 100
opSetWatches = 101
opError = -1
opNotify = 0
opCreate = 1
opDelete = 2
opExists = 3
opGetData = 4
opSetData = 5
opGetAcl = 6
opSetAcl = 7
opGetChildren = 8
opSync = 9
opPing = 11
opGetChildren2 = 12
opCheck = 13
opMulti = 14
opReconfig = 16
opCreateContainer = 19
opCreateTTL = 21
opClose = -11
opSetAuth = 100
opSetWatches = 101
opError = -1
// Not in protocol, used internally
opWatcherEvent = -2
)
Expand Down Expand Up @@ -74,7 +74,7 @@ const (
const (
FlagEphemeral = 1
FlagSequence = 2
FlagTTL = 4
FlagTTL = 4
)

var (
Expand Down Expand Up @@ -194,26 +194,26 @@ const (
var (
emptyPassword = []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
opNames = map[int32]string{
opNotify: "notify",
opCreate: "create",
opCreateContainer: "createContainer",
opCreateTTL: "createTTL",
opDelete: "delete",
opExists: "exists",
opGetData: "getData",
opSetData: "setData",
opGetAcl: "getACL",
opSetAcl: "setACL",
opGetChildren: "getChildren",
opSync: "sync",
opPing: "ping",
opGetChildren2: "getChildren2",
opCheck: "check",
opMulti: "multi",
opReconfig: "reconfig",
opClose: "close",
opSetAuth: "setAuth",
opSetWatches: "setWatches",
opNotify: "notify",
opCreate: "create",
opCreateContainer: "createContainer",
opCreateTTL: "createTTL",
opDelete: "delete",
opExists: "exists",
opGetData: "getData",
opSetData: "setData",
opGetAcl: "getACL",
opSetAcl: "setACL",
opGetChildren: "getChildren",
opSync: "sync",
opPing: "ping",
opGetChildren2: "getChildren2",
opCheck: "check",
opMulti: "multi",
opReconfig: "reconfig",
opClose: "close",
opSetAuth: "setAuth",
opSetWatches: "setWatches",

opWatcherEvent: "watcherEvent",
}
Expand Down
2 changes: 1 addition & 1 deletion structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ type CreateTTLRequest struct {
Data []byte
Acl []ACL
Flags int32
Ttl int64
Ttl int64
}

type createResponse pathResponse
Expand Down
3 changes: 1 addition & 2 deletions zk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ func TestCreateTTL(t *testing.T) {
t.Fatalf("Create returned error: %+v", err)
} else if !strings.HasPrefix(p, path) {
t.Fatalf("Create returned invalid path '%s' are not '%s' with sequence", p, path)
}
if data, stat, err := zk.Get(path); err != nil {
} else if data, stat, err := zk.Get(p); err != nil {
t.Fatalf("Get returned error: %+v", err)
} else if stat == nil {
t.Fatal("Get returned nil stat")
Expand Down

0 comments on commit 74fff30

Please sign in to comment.