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: maxp_gen.go
    path of file: ./repos/caire/vendor/github.com/go-text/typesetting/opentype/tables
    
    the code of the file until where you have to start completion: // SPDX-License-Identifier: Unlicense OR BSD-3-Clause

package tables

import (
	"encoding/binary"
	"fmt"
)

// Code generated by binarygen from maxp_src.go. DO NOT EDIT

func ParseMaxp(src []byte) (Maxp, int, error) {
	v
    
func ParseMaxp(src []byte) (Maxp, int, error) {
	var item Maxp
	n := 0
	if L := len(src); L < 6 {
		return item, 0, fmt.Errorf("reading Maxp: "+"EOF: expected length: 6, got %d", L)
	}
	_ = src[5] // early bound checking
	item.version = maxpVersion(binary.BigEndian.Uint32(src[0:]))
	item.NumGlyphs = binary.BigEndian.Uint16(src[4:])
	n += 6

	{
		var (
			read int
			err  error
		)
		switch item.version {
		case maxpVersion05:
			item.data, read, err = parseMaxpData05(src[6:])
		case maxpVersion1:
			item.data, read, err = parseMaxpData1(src[6:])
		default:
			err = fmt.Errorf("unsupported maxpDataVersion %d", item.version)
		}
		if err != nil {
			return item, 0, fmt.Errorf("reading Maxp: %s", err)
		}
		n += read
	}
	return item, n, nil
}