code: func (s *SkipList) Set(key, value interface{}) {
  	if key == nil {
  		panic("goskiplist: nil keys are not supported")
  	}
  	// s.level starts from 0, so we need to allocate one.
  	update := make([]*node, s.level()+1, s.effectiveMaxLevel()+1)
  	candidate := s.getPath(s.header, update, key)
  
  	if candidate != nil && candidate.key == key {
  		candidate.value = value
  		return
  	}
  
  	newLevel := s.randomLevel()
  
  	if currentLevel := s.level(); newLevel > currentLevel {
  		// there are no pointers for the higher levels in
  		// update. Header should be there. Also add higher
  		// level links to the header.
  		for i := currentLevel + 1; i <= newLevel; i++ {
  			update = append(update, s.header)
  			s.header.forward = append(s.header.forward, nil)
  		}
  	}
  
  	newNode := &node{
  		forward: make([]*node, newLevel+1, s.effectiveMaxLevel()+1),
  		key:     key,
  		value:   value,
  	}
  
  	if previous := update[0]; previous.key != nil {
  		newNode.backward = previous
  	}
  
  	for i := 0; i <= newLevel; i++ {
  		newNode.forward[i] = update[i].forward[i]
  		update[i].forward[i] = newNode
  	}
  
  	s.length++
  
  	if newNode.forward[0] != nil {
  		if newNode.forward[0].backward != newNode {
  			newNode.forward[0].backward = newNode
  		}
  	}
  
  	if s.footer == nil || s.lessThan(s.footer.key, key) {
  		s.footer = newNode
  	}
  }
docs: // Sets set the value associated with key in s.