Docs
This commit is contained in:
parent
e8d2364048
commit
7aa733c7de
|
@ -64,14 +64,11 @@ func (s *DataStore) GetFileChunks(id string) (chunkSet, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
lines := strings.Split(string(data), "\n")
|
lines := strings.Split(string(data), "\n")
|
||||||
|
// last line is always empty, lets skip it
|
||||||
|
lines = lines[:len(lines)-1]
|
||||||
|
|
||||||
chunks := make(chunkSet, 0, len(lines)-1)
|
chunks := make(chunkSet, 0, len(lines))
|
||||||
for i, line := range lines {
|
for _, line := range lines {
|
||||||
// last line is always empty, skip it
|
|
||||||
if lastLine := i+1 == len(lines); lastLine {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
entry := logEntry{}
|
entry := logEntry{}
|
||||||
if err := json.Unmarshal([]byte(line), &entry); err != nil {
|
if err := json.Unmarshal([]byte(line), &entry); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue