linter fixes - reorder return vals, remove unused const

This commit is contained in:
Matt Jaffee 2018-09-12 13:24:28 -05:00
parent 156260e68e
commit a3243f99e1
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF
2 changed files with 6 additions and 7 deletions

View file

@ -3343,15 +3343,13 @@ func popcountAndSlice(s, m []uint64) uint64 {
}
// constants from github.com/RoaringBitmap/roaring
const ( //taken from roaring/util.go
// taken from roaring/util.go
const (
serialCookieNoRunContainer = 12346 // only arrays and bitmaps
serialCookie = 12347 // runs, arrays, and bitmaps
noOffsetThreshold = 4
)
//end roaring stuff
func readStandardHeader(buf []byte) (size uint32, containerTyper func(index uint, card int) byte, header, pos int, err error, haveRuns bool) {
func readStandardHeader(buf []byte) (size uint32, containerTyper func(index uint, card int) byte, header, pos int, haveRuns bool, err error) {
if len(buf) < 8 {
err = fmt.Errorf("buffer too small, expecting at least 8 bytes, was %d", len(buf))
return
@ -3418,7 +3416,7 @@ func (b *Bitmap) UnmarshalBinary(data []byte) error {
return errors.Wrap(b.unmarshalPilosaRoaring(data), "unmarshaling as pilosa roaring")
}
keyN, containerTyper, header, pos, err, haveRuns := readStandardHeader(data)
keyN, containerTyper, header, pos, haveRuns, err := readStandardHeader(data)
if err != nil {
return errors.Wrap(err, "reading roaring header")
}

View file

@ -568,7 +568,8 @@ func TestHandler_Endpoints(t *testing.T) {
if result.StatusCode != 200 {
t.Fatalf("CORS preflight status should be 200, but is %v", result.StatusCode)
}
if w.HeaderMap["Access-Control-Allow-Origin"][0] != "http://test/" {
if result.Header["Access-Control-Allow-Origin"][0] != "http://test/" {
t.Fatal("CORS header not present")
}
})