code: func (f *Frame) unmarshalVLANs(tpid EtherType, b []byte) (int, error) {
  	// 4 or more bytes must remain for valid S/C-VLAN tag and EtherType.
  	if len(b) < 4 {
  		return 0, io.ErrUnexpectedEOF
  	}
  
  	// Track how many bytes are consumed by VLAN tags.
  	var n int
  
  	switch tpid {
  	case EtherTypeServiceVLAN:
  		vlan := new(VLAN)
  		if err := vlan.UnmarshalBinary(b[n : n+2]); err != nil {
  			return 0, err
  		}
  		f.ServiceVLAN = vlan
  
  		// Assume that a C-VLAN immediately trails an S-VLAN.
  		if EtherType(binary.BigEndian.Uint16(b[n+2:n+4])) != EtherTypeVLAN {
  			return 0, ErrInvalidVLAN
  		}
  
  		// 4 or more bytes must remain for valid C-VLAN tag and EtherType.
  		n += 4
  		if len(b[n:]) < 4 {
  			return 0, io.ErrUnexpectedEOF
  		}
  
  		// Continue to parse the C-VLAN.
  		fallthrough
  	case EtherTypeVLAN:
  		vlan := new(VLAN)
  		if err := vlan.UnmarshalBinary(b[n : n+2]); err != nil {
  			return 0, err
  		}
  
  		f.VLAN = vlan
  		f.EtherType = EtherType(binary.BigEndian.Uint16(b[n+2 : n+4]))
  		n += 4
  	default:
  		panic(fmt.Sprintf("unknown VLAN TPID: %04x", tpid))
  	}
  
  	return n, nil
  }
docs: // unmarshalVLANs unmarshals S/C-VLAN tags.  It is assumed that tpid
  // is a valid S/C-VLAN TPID.