summaryrefslogtreecommitdiff
path: root/rrdformat/rrdbinary
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2020-01-26 22:30:00 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2020-01-26 22:30:00 -0500
commit72c4b2518a77ee9952a0fa25ae671f06d8d85570 (patch)
treeecf1aabe3c997a22d0ad1c81f4a165c48182d0f7 /rrdformat/rrdbinary
parent02003547bc96b3758355f0af0275170da1dba942 (diff)
it compiles
Diffstat (limited to 'rrdformat/rrdbinary')
-rw-r--r--rrdformat/rrdbinary/errors.go2
-rw-r--r--rrdformat/rrdbinary/errors_test.go4
-rw-r--r--rrdformat/rrdbinary/types.go2
-rw-r--r--rrdformat/rrdbinary/unmarshal.go6
4 files changed, 7 insertions, 7 deletions
diff --git a/rrdformat/rrdbinary/errors.go b/rrdformat/rrdbinary/errors.go
index 984e0a5..1e61af0 100644
--- a/rrdformat/rrdbinary/errors.go
+++ b/rrdformat/rrdbinary/errors.go
@@ -13,7 +13,7 @@ type BinaryError struct {
ctxEOF bool
}
-func newBinError(msg string, ctxFile []byte, ctxStart, ctxLen int) error {
+func NewBinError(msg string, ctxFile []byte, ctxStart, ctxLen int) error {
if ctxStart+ctxLen > len(ctxFile) {
ctxLen = len(ctxFile) - ctxStart
}
diff --git a/rrdformat/rrdbinary/errors_test.go b/rrdformat/rrdbinary/errors_test.go
index f65929b..86ae809 100644
--- a/rrdformat/rrdbinary/errors_test.go
+++ b/rrdformat/rrdbinary/errors_test.go
@@ -11,7 +11,7 @@ func TestBinaryError(t *testing.T) {
assert := assert.New(t)
bad404 := []byte(`<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"`)
- err := newBinError("not an RRD file: wrong magic number", bad404, 0, 4)
+ err := NewBinError("not an RRD file: wrong magic number", bad404, 0, 4)
assert.Equal(err.Error(), `invalid RRD: not an RRD file: wrong magic number`)
assert.Equal(fmt.Sprintf("%v", err), `invalid RRD: not an RRD file: wrong magic number`)
assert.Equal(fmt.Sprintf("%q", err), `"invalid RRD: not an RRD file: wrong magic number"`)
@@ -22,7 +22,7 @@ func TestBinaryError(t *testing.T) {
`)
badShort := []byte{'R'}
- err = newBinError("not an RRD file: wrong magic number", badShort, 0, 4)
+ err = NewBinError("not an RRD file: wrong magic number", badShort, 0, 4)
assert.Equal(err.Error(), `invalid RRD: not an RRD file: wrong magic number`)
assert.Equal(fmt.Sprintf("%v", err), `invalid RRD: not an RRD file: wrong magic number`)
assert.Equal(fmt.Sprintf("%q", err), `"invalid RRD: not an RRD file: wrong magic number"`)
diff --git a/rrdformat/rrdbinary/types.go b/rrdformat/rrdbinary/types.go
index 36e89fa..a036d5d 100644
--- a/rrdformat/rrdbinary/types.go
+++ b/rrdformat/rrdbinary/types.go
@@ -24,7 +24,7 @@ type Architecture struct {
type String string // \0-terminated
type Float float64 // 8 bytes
type Uint uint64 // 4 or 8 bytes
-type _Int int64 // 4 or 8 bytes
+type Int int64 // 4 or 8 bytes
type Unival uint64 // 8 bytes
type Time int64 // 4 or 8 bytes, only has second-precision
diff --git a/rrdformat/rrdbinary/unmarshal.go b/rrdformat/rrdbinary/unmarshal.go
index e0f8988..1cfee34 100644
--- a/rrdformat/rrdbinary/unmarshal.go
+++ b/rrdformat/rrdbinary/unmarshal.go
@@ -29,7 +29,7 @@ type unmarshaler struct {
}
func (d *unmarshaler) binError(ctxLen int, msg string) error {
- return newBinError(msg, d.data, d.pos, ctxLen)
+ return NewBinError(msg, d.data, d.pos, ctxLen)
}
func (d *unmarshaler) binErrorf(ctxLen int, format string, a ...interface{}) error {
@@ -44,7 +44,7 @@ func (d *unmarshaler) unmarshal(v reflect.Value, tag string) error {
return d.unmarshalFloat(v, tag)
case reflect.TypeOf(Uint(0)):
return d.unmarshalUint(v, tag)
- case reflect.TypeOf(_Int(0)):
+ case reflect.TypeOf(Int(0)):
return d.unmarshalInt(v, tag)
case reflect.TypeOf(Unival(0)):
return d.unmarshalUnival(v, tag)
@@ -213,7 +213,7 @@ func (d *unmarshaler) unmarshalUint(v reflect.Value, tag string) error {
}
func (d *unmarshaler) unmarshalInt(v reflect.Value, tag string) error {
- panicUnless(v.Type() == reflect.TypeOf(_Int(0)))
+ panicUnless(v.Type() == reflect.TypeOf(Int(0)))
panicUnless(v.CanSet())
if d.arch.IntWidth != 4 && d.arch.IntWidth != 8 {