mirror of https://github.com/dsoprea/go-exif.git
type_encode.go: Add redundancy comments
parent
3a4fc51e30
commit
1ae6e31ca9
|
@ -15,8 +15,10 @@ var (
|
|||
|
||||
// EncodedData encapsulates the compound output of an encoding operation.
|
||||
type EncodedData struct {
|
||||
Type TagTypePrimitive
|
||||
Encoded []byte
|
||||
Type TagTypePrimitive
|
||||
Encoded []byte
|
||||
|
||||
// TODO(dustin): Is this really necessary? We might have this just to correlate to the incoming stream format (raw bytes and a unit-count both for incoming and outgoing).
|
||||
UnitCount uint32
|
||||
}
|
||||
|
||||
|
@ -185,6 +187,8 @@ func (ve *ValueEncoder) Encode(value interface{}) (ed EncodedData, err error) {
|
|||
}
|
||||
}()
|
||||
|
||||
// TODO(dustin): This is redundant with EncodeWithType. Refactor one to use the other.
|
||||
|
||||
switch value.(type) {
|
||||
case []byte:
|
||||
ed, err = ve.encodeBytes(value.([]byte))
|
||||
|
@ -223,6 +227,8 @@ func (ve *ValueEncoder) EncodeWithType(tt TagType, value interface{}) (ed Encode
|
|||
}
|
||||
}()
|
||||
|
||||
// TODO(dustin): This is redundant with Encode. Refactor one to use the other.
|
||||
|
||||
switch tt.Type() {
|
||||
case TypeByte:
|
||||
ed, err = ve.encodeBytes(value.([]byte))
|
||||
|
|
Loading…
Reference in New Issue