code: func SetPortSlice(peers []string, addr string) ([]string, error) {
  	// Retrieve the port from addr.
  	_, port, err := net.SplitHostPort(addr)
  	if err != nil {
  		return nil, err
  	}
  
  	// Merge the port with the peer hosts into a new slice.
  	other := make([]string, len(peers))
  	for i, peer := range peers {
  		host, _, err := net.SplitHostPort(peer)
  		if err != nil {
  			return nil, err
  		}
  
  		other[i] = net.JoinHostPort(host, port)
  	}
  
  	return other, nil
  }
docs: // SetPortSlice sets the ports for a slice of hosts.