Giter Club home page Giter Club logo

go-rendezvous's Issues

Lookup panics when there are no nodes

package main

import (
	"github.com/cespare/xxhash"
	"github.com/dgryski/go-rendezvous"
)

func main() {
	r := rendezvous.New([]string{}, xxhash.Sum64String)
	r.Lookup("hello")
}
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/dgryski/go-rendezvous.(*Rendezvous).Lookup(0xc00010a000, 0x4a0582, 0x5, 0x4a6870, 0xc00010a000)
	/home/vmihailenco/gocode/pkg/mod/github.com/dgryski/[email protected]/rdv.go:33 +0x145

https://github.com/golang/groupcache/blob/master/consistenthash/consistenthash.go#L66-L68 returns empty string in such case.

License!

Hey @dgryski! This lovely tiny package doesn't have a license, and it has been added as a dependency on go-redis: redis/go-redis#1361

Could you please add a license so we can tick some compliance checkboxes? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.