From 22222b24d02c45ce88781bd895a26eb0d3c6c61a Mon Sep 17 00:00:00 2001 From: Dustin Oprea Date: Wed, 1 Jan 2020 02:45:37 -0500 Subject: [PATCH] Minor tweaks/renamings --- ifd_tag_entry_test.go | 18 +++++++++--------- value_context.go | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ifd_tag_entry_test.go b/ifd_tag_entry_test.go index 396265e..8aa1db0 100644 --- a/ifd_tag_entry_test.go +++ b/ifd_tag_entry_test.go @@ -7,7 +7,7 @@ import ( "github.com/dsoprea/go-logging" ) -func Test_IfdTagEntry_ValueString_Allocated(t *testing.T) { +func TestIfdTagEntry_ValueString_Allocated(t *testing.T) { ite := IfdTagEntry{ TagId: 0x1, TagIndex: 0, @@ -29,7 +29,7 @@ func Test_IfdTagEntry_ValueString_Allocated(t *testing.T) { } } -func Test_IfdTagEntry_ValueString_Embedded(t *testing.T) { +func TestIfdTagEntry_ValueString_Embedded(t *testing.T) { data := []byte{0x11, 0x22, 0x33, 0x44} ite := IfdTagEntry{ @@ -51,7 +51,7 @@ func Test_IfdTagEntry_ValueString_Embedded(t *testing.T) { } } -func Test_IfdTagEntry_ValueString_Unknown(t *testing.T) { +func TestIfdTagEntry_ValueString_Unknown(t *testing.T) { data := []uint8{'0', '2', '3', '0'} ite := IfdTagEntry{ @@ -73,7 +73,7 @@ func Test_IfdTagEntry_ValueString_Unknown(t *testing.T) { } } -func Test_IfdTagEntry_ValueBytes_Allocated(t *testing.T) { +func TestIfdTagEntry_ValueBytes_Allocated(t *testing.T) { ite := IfdTagEntry{ TagId: 0x1, TagIndex: 0, @@ -94,7 +94,7 @@ func Test_IfdTagEntry_ValueBytes_Allocated(t *testing.T) { } } -func Test_IfdTagEntry_ValueBytes_Embedded(t *testing.T) { +func TestIfdTagEntry_ValueBytes_Embedded(t *testing.T) { data := []byte{0x11, 0x22, 0x33, 0x44} ite := IfdTagEntry{ @@ -115,7 +115,7 @@ func Test_IfdTagEntry_ValueBytes_Embedded(t *testing.T) { } } -func Test_IfdTagEntry_Value_Normal(t *testing.T) { +func TestIfdTagEntry_Value_Normal(t *testing.T) { data := []byte{0x11, 0x22, 0x33, 0x44} ite := IfdTagEntry{ @@ -136,7 +136,7 @@ func Test_IfdTagEntry_Value_Normal(t *testing.T) { } } -func Test_IfdTagEntry_Value_Unknown(t *testing.T) { +func TestIfdTagEntry_Value_Unknown(t *testing.T) { data := []uint8{'0', '2', '3', '0'} ite := IfdTagEntry{ @@ -162,7 +162,7 @@ func Test_IfdTagEntry_Value_Unknown(t *testing.T) { } } -func Test_IfdTagEntry_String(t *testing.T) { +func TestIfdTagEntry_String(t *testing.T) { ite := IfdTagEntry{ TagId: 0x1, TagIndex: 0, @@ -179,7 +179,7 @@ func Test_IfdTagEntry_String(t *testing.T) { } } -func Test_IfdTagEntryValueResolver_ValueBytes(t *testing.T) { +func TestIfdTagEntryValueResolver_ValueBytes(t *testing.T) { allocatedData := []byte{0x11, 0x22, 0x33, 0x44, 0x55, 0x66} ite := IfdTagEntry{ diff --git a/value_context.go b/value_context.go index e542ad1..c5adff2 100644 --- a/value_context.go +++ b/value_context.go @@ -295,7 +295,7 @@ func (vc *ValueContext) ReadSignedRationals() (value []SignedRational, err error // Since this method lacks the information to process unknown-type tags (e.g. // byte-order, tag-ID, IFD type), it will return an error if attempted. See // `Undefined()`. -func (vc *ValueContext) Values() (value interface{}, err error) { +func (vc *ValueContext) Values() (values interface{}, err error) { defer func() { if state := recover(); state != nil { err = log.Wrap(state.(error)) @@ -303,28 +303,28 @@ func (vc *ValueContext) Values() (value interface{}, err error) { }() if vc.tagType == TypeByte { - value, err = vc.ReadBytes() + values, err = vc.ReadBytes() log.PanicIf(err) } else if vc.tagType == TypeAscii { - value, err = vc.ReadAscii() + values, err = vc.ReadAscii() log.PanicIf(err) } else if vc.tagType == TypeAsciiNoNul { - value, err = vc.ReadAsciiNoNul() + values, err = vc.ReadAsciiNoNul() log.PanicIf(err) } else if vc.tagType == TypeShort { - value, err = vc.ReadShorts() + values, err = vc.ReadShorts() log.PanicIf(err) } else if vc.tagType == TypeLong { - value, err = vc.ReadLongs() + values, err = vc.ReadLongs() log.PanicIf(err) } else if vc.tagType == TypeRational { - value, err = vc.ReadRationals() + values, err = vc.ReadRationals() log.PanicIf(err) } else if vc.tagType == TypeSignedLong { - value, err = vc.ReadSignedLongs() + values, err = vc.ReadSignedLongs() log.PanicIf(err) } else if vc.tagType == TypeSignedRational { - value, err = vc.ReadSignedRationals() + values, err = vc.ReadSignedRationals() log.PanicIf(err) } else if vc.tagType == TypeUndefined { log.Panicf("will not parse undefined-type value") @@ -338,7 +338,7 @@ func (vc *ValueContext) Values() (value interface{}, err error) { return nil, nil } - return value, nil + return values, nil } // Undefined attempts to identify and decode supported undefined-type fields.