code: func (w *weightedRandomSelect) choose() wrsItem {
  	for {
  		if w.root.sumWeight == 0 {
  			return nil
  		}
  		val := rand.Int63n(w.root.sumWeight)
  		choice, lastWeight := w.root.choose(val)
  		weight := choice.Weight()
  		if weight != lastWeight {
  			w.setWeight(choice, weight)
  		}
  		if weight >= lastWeight || rand.Int63n(lastWeight) < weight {
  			return choice
  		}
  	}
  }
docs: // choose randomly selects an item from the set, with a chance proportional to its
  // current weight. If the weight of the chosen element has been decreased since the
  // last stored value, returns it with a newWeight/oldWeight chance, otherwise just
  // updates its weight and selects another one