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: ot_layout_gsubgpos.go
    path of file: ./repos/caire/vendor/github.com/go-text/typesetting/harfbuzz
    
    the code of the file until where you have to start completion: package harfbuzz

import (
	"fmt"
	"math"

	"github.com/go-text/typesetting/opentype/api/font"
	"github.com/go-text/typesetting/opentype/tables"
)

// ported from harfbuzz/src/hb-ot-layout-gsubgpos.hh Copyright Â© 2007,2008,2009,2010  Red Hat, Inc. 2010,2012  Google, Inc.  Behdad Esfahbo
    
func (c *otApplyContext) contextApplyLookup(input []uint16, lookupRecord []tables.SequenceLookupRecord, lookupContext matcherFunc) bool {
	matchEnd := 0
	var matchPositions [maxContextLength]int
	hasMatch, matchEnd, _ := c.matchInput(input, lookupContext, &matchPositions)
	if hasMatch {
		c.buffer.unsafeToBreak(c.buffer.idx, matchEnd)
		c.applyLookup(len(input)+1, &matchPositions, lookupRecord, matchEnd)
		return true
	} else {
		c.buffer.unsafeToConcat(c.buffer.idx, matchEnd)
		return false
	}
}