Merge lp://staging/~niemeyer/gozk/int32-to-int into lp://staging/gozk/zookeeper

Proposed by Gustavo Niemeyer
Status: Merged
Merged at revision: 28
Proposed branch: lp://staging/~niemeyer/gozk/int32-to-int
Merge into: lp://staging/gozk/zookeeper
Diff against target: 287 lines (+39/-39)
3 files modified
retry_test.go (+14/-14)
zk.go (+13/-13)
zk_test.go (+12/-12)
To merge this branch: bzr merge lp://staging/~niemeyer/gozk/int32-to-int
Reviewer Review Type Date Requested Status
The Go Language Gophers Pending
Review via email: mp+93252@code.staging.launchpad.net

Description of the change

Use int32 rather than int for stat fields.

https://codereview.appspot.com/5675059/

To post a comment you must log in.
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

Please take a look.

Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :
Download full text (9.7 KiB)

Reviewers: mp+93252_code.launchpad.net,

Message:
Please take a look.

Description:

https://code.launchpad.net/~niemeyer/gozk/int32-to-int/+merge/93252

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/5675059/

Affected files:
   M retry_test.go
   M zk.go
   M zk_test.go

Index: retry_test.go
=== <email address hidden> >
<email address hidden>
=== modified file 'retry_test.go'
--- retry_test.go 2011-11-29 17:44:18 +0000
+++ retry_test.go 2012-02-15 17:18:34 +0000
@@ -20,7 +20,7 @@
   data, stat, err := conn.Get("/test")
   c.Assert(err, IsNil)
   c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(0))
+ c.Assert(stat.Version(), Equals, 0)
   c.Assert(data, Equals, "new")

   acl, _, err := conn.ACL("/test")
@@ -38,7 +38,7 @@
    func(data string, stat *zk.Stat) (string, error) {
     c.Assert(data, Equals, "old")
     c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(0))
+ c.Assert(stat.Version(), Equals, 0)
     return "brand new", nil
    })
   c.Assert(err, IsNil)
@@ -46,7 +46,7 @@
   data, stat, err := conn.Get("/test")
   c.Assert(err, IsNil)
   c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(1))
+ c.Assert(stat.Version(), Equals, 1)
   c.Assert(data, Equals, "brand new")

   // ACL was unchanged by RetryChange().
@@ -65,7 +65,7 @@
    func(data string, stat *zk.Stat) (string, error) {
     c.Assert(data, Equals, "old")
     c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(0))
+ c.Assert(stat.Version(), Equals, 0)
     return "old", nil
    })
   c.Assert(err, IsNil)
@@ -73,7 +73,7 @@
   data, stat, err := conn.Get("/test")
   c.Assert(err, IsNil)
   c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(0)) // Unchanged!
+ c.Assert(stat.Version(), Equals, 0) // Unchanged!
   c.Assert(data, Equals, "old")
  }

@@ -90,7 +90,7 @@
     return "<none> => conflict", nil
    case "conflict":
     c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(0))
+ c.Assert(stat.Version(), Equals, 0)
     return "conflict => new", nil
    default:
     c.Fatal("Unexpected node data: " + data)
@@ -105,7 +105,7 @@
   c.Assert(err, IsNil)
   c.Assert(data, Equals, "conflict => new")
   c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(1))
+ c.Assert(stat.Version(), Equals, 1)
  }

  func (s *S) TestRetryChangeConflictOnSetDueToChange(c *C) {
@@ -118,13 +118,13 @@
    switch data {
    case "old":
     c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(0))
+ c.Assert(stat.Version(), Equals, 0)
     _, err := conn.Set("/test", "conflict", 0)
     c.Assert(err, IsNil)
     return "old => new", nil
    case "conflict":
     c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(1))
+ c.Assert(stat.Version(), Equals, 1)
     return "conflict => new", nil
    default:
     c.Fatal("Unexpected node data: " + data)
@@ -139,7 +139,7 @@
   c.Assert(err, IsNil)
   c.Assert(data, Equals, "conflict => new")
   c.Assert(stat, NotNil)
- c.Assert(stat.Version(), Equals, int32(2))
+ c.Assert(stat.Version(), Equals, 2)
  }

 ...

Read more...

Revision history for this message
William Reade (fwereade) wrote :
Revision history for this message
Roger Peppe (rogpeppe) wrote :
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

*** Submitted:

Use int32 rather than int for stat fields.

R=fwereade, TheMue, rog
CC=
https://codereview.appspot.com/5675059

https://codereview.appspot.com/5675059/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches