code: func (m *multiaddr) Protocols() []Protocol {
  	ps := make([]Protocol, 0, 8)
  	b := m.bytes
  	for len(b) > 0 {
  		code, n, err := ReadVarintCode(b)
  		if err != nil {
  			panic(err)
  		}
  
  		p := ProtocolWithCode(code)
  		if p.Code == 0 {
  			// this is a panic (and not returning err) because this should've been
  			// caught on constructing the Multiaddr
  			panic(fmt.Errorf("no protocol with code %d", b[0]))
  		}
  		ps = append(ps, p)
  		b = b[n:]
  
  		n, size, err := sizeForAddr(p, b)
  		if err != nil {
  			panic(err)
  		}
  
  		b = b[n+size:]
  	}
  	return ps
  }
docs: // Protocols returns the list of protocols this Multiaddr has.
  // will panic in case we access bytes incorrectly.