Browse code

Correct mismatched function names (UID() and Gid())

All the go-lint work forced any existing "Uid" -> "UID", but seems to
not have the same rules for Gid, so stat package has calls UID() and
Gid().

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)

Phil Estes authored on 2015/10/12 23:58:33
Showing 5 changed files
... ...
@@ -28,7 +28,7 @@ func copyOwnership(source, destination string) error {
28 28
 		return err
29 29
 	}
30 30
 
31
-	if err := os.Chown(destination, int(stat.UID()), int(stat.Gid())); err != nil {
31
+	if err := os.Chown(destination, int(stat.UID()), int(stat.GID())); err != nil {
32 32
 		return err
33 33
 	}
34 34
 
... ...
@@ -80,5 +80,5 @@ func (s *DockerDaemonSuite) TestDaemonUserNamespaceRootSetting(c *check.C) {
80 80
 		c.Fatal(err)
81 81
 	}
82 82
 	c.Assert(stat.UID(), check.Equals, uint32(uid), check.Commentf("Touched file not owned by remapped root UID"))
83
-	c.Assert(stat.Gid(), check.Equals, uint32(gid), check.Commentf("Touched file not owned by remapped root GID"))
83
+	c.Assert(stat.GID(), check.Equals, uint32(gid), check.Commentf("Touched file not owned by remapped root GID"))
84 84
 }
... ...
@@ -12,7 +12,7 @@ func statDifferent(oldStat *system.StatT, newStat *system.StatT) bool {
12 12
 	// Don't look at size for dirs, its not a good measure of change
13 13
 	if oldStat.Mode() != newStat.Mode() ||
14 14
 		oldStat.UID() != newStat.UID() ||
15
-		oldStat.Gid() != newStat.Gid() ||
15
+		oldStat.GID() != newStat.GID() ||
16 16
 		oldStat.Rdev() != newStat.Rdev() ||
17 17
 		// Don't look at size for dirs, its not a good measure of change
18 18
 		(oldStat.Mode()&syscall.S_IFDIR != syscall.S_IFDIR &&
... ...
@@ -27,8 +27,8 @@ func (s StatT) UID() uint32 {
27 27
 	return s.uid
28 28
 }
29 29
 
30
-// Gid returns file's group id of owner.
31
-func (s StatT) Gid() uint32 {
30
+// GID returns file's group id of owner.
31
+func (s StatT) GID() uint32 {
32 32
 	return s.gid
33 33
 }
34 34
 
... ...
@@ -27,7 +27,7 @@ func TestFromStatT(t *testing.T) {
27 27
 	if stat.Uid != s.UID() {
28 28
 		t.Fatal("got invalid uid")
29 29
 	}
30
-	if stat.Gid != s.Gid() {
30
+	if stat.Gid != s.GID() {
31 31
 		t.Fatal("got invalid gid")
32 32
 	}
33 33
 	if stat.Rdev != s.Rdev() {