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: optype.go
    path of file: ./repos/k6/vendor/github.com/goccy/go-json/internal/encoder
    
    the code of the file until where you have to start completion: // Code generated by internal/cmd/generator. DO NOT EDIT!
package encoder

import (
	"strings"
)

type CodeType int

const (
	CodeOp          CodeType = 0
	CodeArrayHead   CodeType = 1
	CodeArrayElem   CodeType = 2
	CodeSliceHe
    
func (t OpType) HeadToPtrHead() OpType {
	if strings.Index(t.String(), "PtrHead") > 0 {
		return t
	}

	idx := strings.Index(t.String(), "Head")
	if idx == -1 {
		return t
	}
	suffix := "PtrHead" + t.String()[idx+len("Head"):]

	const toPtrOffset = 2
	if strings.Contains(OpType(int(t)+toPtrOffset).String(), suffix) {
		return OpType(int(t) + toPtrOffset)
	}
	return t
}