浏览代码

Refactored function name

Signed-off-by: Vishal Rana <vr@labstack.com>
Vishal Rana 10 年之前
父节点
当前提交
f9401b795b
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 4 4
      gytes/gytes.go
  2. 1 1
      gytes/gytes_test.go

+ 4 - 4
gytes/gytes.go

@@ -20,8 +20,8 @@ func New() *Gytes {
 	return &Gytes{}
 	return &Gytes{}
 }
 }
 
 
-// BinaryPrefix turns on binary prefix format.
-func (g *Gytes) BinaryPrefix(on bool) {
+// SetBinaryPrefix sets binary prefix format.
+func (g *Gytes) SetBinaryPrefix(on bool) {
 	g.iec = on
 	g.iec = on
 }
 }
 
 
@@ -49,9 +49,9 @@ func (g *Gytes) Format(b uint64) string {
 	}
 	}
 }
 }
 
 
-// BinaryPrefix wraps default instance's BinaryPrefix function.
+// SetBinaryPrefix wraps default instance's BinaryPrefix function.
 func BinaryPrefix(on bool) {
 func BinaryPrefix(on bool) {
-	global.BinaryPrefix(on)
+	global.SetBinaryPrefix(on)
 }
 }
 
 
 // Format wraps default instance's Format function.
 // Format wraps default instance's Format function.

+ 1 - 1
gytes/gytes_test.go

@@ -38,7 +38,7 @@ func TestNew(t *testing.T) {
 	}
 	}
 
 
 	// Binary prefix
 	// Binary prefix
-	g.BinaryPrefix(true)
+	g.SetBinaryPrefix(true)
 	println(g.Format(13231323))
 	println(g.Format(13231323))
 	b = Format(1323132313231323)
 	b = Format(1323132313231323)
 	if b != "1.18 PiB" {
 	if b != "1.18 PiB" {