Browse Source

Refactored function name

Signed-off-by: Vishal Rana <vr@labstack.com>
Vishal Rana 10 years ago
parent
commit
f9401b795b
2 changed files with 5 additions and 5 deletions
  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{}
 }
 
-// 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
 }
 
@@ -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) {
-	global.BinaryPrefix(on)
+	global.SetBinaryPrefix(on)
 }
 
 // Format wraps default instance's Format function.

+ 1 - 1
gytes/gytes_test.go

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