code: func (t *Transport) longestActive() (*peer, error) {
  	var longest *peer
  	var longestTime time.Time
  	t.mu.Lock()
  	defer t.mu.Unlock()
  	for _, p := range t.peers {
  		becameActive := p.activeTime()
  		if becameActive.IsZero() {
  			continue
  		}
  		if longest == nil {
  			longest = p
  			continue
  		}
  		if becameActive.Before(longestTime) {
  			longest = p
  			longestTime = becameActive
  		}
  	}
  	if longest == nil {
  		return nil, errors.New("failed to find longest active peer")
  	}
  	return longest, nil
  }
docs: // longestActive returns the peer that has been active for the longest length of
  // time.