Skip to content

Commit 53692a9

Browse files
committed
cleanup index.Get's signature
1 parent 192cbce commit 53692a9

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

catalogd/internal/storage/index.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (i index) Size() int64 {
6464
return int64(size)
6565
}
6666

67-
func (i index) Get(r io.ReaderAt, schema, packageName, name string) (io.Reader, bool) {
67+
func (i index) Get(r io.ReaderAt, schema, packageName, name string) io.Reader {
6868
sectionSet := i.getSectionSet(schema, packageName, name)
6969

7070
sections := sectionSet.UnsortedList()
@@ -77,7 +77,7 @@ func (i index) Get(r io.ReaderAt, schema, packageName, name string) (io.Reader,
7777
sr := io.NewSectionReader(r, s.offset, s.length)
7878
srs = append(srs, sr)
7979
}
80-
return io.MultiReader(srs...), true
80+
return io.MultiReader(srs...)
8181
}
8282

8383
func (i *index) getSectionSet(schema, packageName, name string) sets.Set[section] {

catalogd/internal/storage/localdir.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,7 @@ func (s *LocalDirV1) handleV1Query(w http.ResponseWriter, r *http.Request) {
241241
httpError(w, err)
242242
return
243243
}
244-
indexReader, ok := idx.Get(catalogFile, schema, pkg, name)
245-
if !ok {
246-
httpError(w, fs.ErrNotExist)
247-
return
248-
}
244+
indexReader := idx.Get(catalogFile, schema, pkg, name)
249245
serveJSONLinesQuery(w, indexReader)
250246
}
251247

0 commit comments

Comments
 (0)