|
|
|
@ -6,6 +6,8 @@ package tape
|
|
|
|
// TODO: add support for struct tags: `tape:"0000"`, tape:"0001"` so they can get
|
|
|
|
// TODO: add support for struct tags: `tape:"0000"`, tape:"0001"` so they can get
|
|
|
|
// transformed into tables with a defined schema
|
|
|
|
// transformed into tables with a defined schema
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: test all of these smaller functions individually
|
|
|
|
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
import "fmt"
|
|
|
|
import "reflect"
|
|
|
|
import "reflect"
|
|
|
|
|
|
|
|
|
|
|
|
@ -346,10 +348,12 @@ func peekSlice(decoder *Decoder, tag Tag) (Tag, int, error) {
|
|
|
|
for {
|
|
|
|
for {
|
|
|
|
elem, populated, n, err := peekSliceOnce(decoder, tag, offset)
|
|
|
|
elem, populated, n, err := peekSliceOnce(decoder, tag, offset)
|
|
|
|
if err != nil { return 0, 0, err }
|
|
|
|
if err != nil { return 0, 0, err }
|
|
|
|
offset += n
|
|
|
|
offset = n
|
|
|
|
dimension += 1
|
|
|
|
dimension += 1
|
|
|
|
if elem.Is(OTA) {
|
|
|
|
if elem.Is(OTA) {
|
|
|
|
if !populated {
|
|
|
|
if !populated {
|
|
|
|
|
|
|
|
// default to a large byte array, will be
|
|
|
|
|
|
|
|
// interpreted as a string.
|
|
|
|
return LBA, dimension + 1, nil
|
|
|
|
return LBA, dimension + 1, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|