You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: util.go
    path of file: ./repos/sealer/vendor/github.com/multiformats/go-multiaddr
    
    the code of the file until where you have to start completion: package multiaddr

import "fmt"

// Split returns the sub-address portions of a multiaddr.
func Split(m Multiaddr) []Multiaddr {
	if _, ok := m.(*Component); ok {
		return []Multiaddr{m}
	}
	var addrs []Multiaddr
	ForEach(m, func(c Component) bool {
		addrs = append(addrs, &c)
		return true
	})
	return addrs
}

// Join returns a combination of addresses.
func Join(ms ...Multiaddr) Mu
    
func SplitLast(m Multiaddr) (Multiaddr, *Component) {
	// Shortcut if we already have a component
	if c, ok := m.(*Component); ok {
		return nil, c
	}

	b := m.Bytes()
	if len(b) == 0 {
		return nil, nil
	}

	var (
		c      Component
		err    error
		offset int
	)
	for {
		var n int
		n, c, err = readComponent(b[offset:])
		if err != nil {
			panic(err)
		}
		if len(b) == n+offset {
			// Reached end
			if offset == 0 {
				// Only one component
				return nil, &c
			}
			return &multiaddr{b[:offset]}, &c
		}
		offset += n
	}
}