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: pg_heap.go
    path of file: ./repos/fq/format/postgres/common/pg_heap/postgres
    
    the code of the file until where you have to start completion: package postgres

import (
	"fmt"

	"github.com/wader/fq/format"
	"github.com/wader/fq/format/postgres/common"

	"github.com/wader/fq/pkg/decode"
	"github.com/wader/fq/pkg/scalar"
)

const (
	HEAP_HASNULL          = 0x0001 /* has null attribute(s) */
	HEAP_HASVARWIDTH      = 0x0002 /* has variable-width attribute(s) */
	HEAP_HASEXTERNAL      = 0x0004 /* has external stored attribute(s) */
	HEAP_HASOID_OLD       = 0x0008 /* has an object-id field */
	HEAP_XMAX_KEYSHR_LOCK = 0x0010 /* xmax is a key-shared locker */
	HEAP_COMBOCID         = 0x0020 /* t_cid is a combo CID */
	HEAP_XMAX_EXCL_LOCK   = 0x0040 
    
func decodeHeapPage(heap *Heap, d *decode.D, blockNumber uint32) {
	page := &HeapPage{}
	if heap.Page != nil {
		// use prev page
		page.BytesPosBegin = heap.Page.BytesPosEnd
	}
	page.BytesPosEnd = int64(common.TypeAlign(common.PageSize, uint64(page.BytesPosBegin)+1))
	heap.Page = page
	heap.Special = &PageSpecial{}

	checkSum := calcCheckSum(d, blockNumber)

	d.FieldStruct("page_header", func(d *decode.D) {
		heap.DecodePageHeaderData(page, d)

		d.FieldValueUint("pd_checksum_check", uint64(checkSum))
		sumEqual := page.PdChecksum == checkSum
		d.FieldValueBool("pd_checksum_check_equal", sumEqual)
	})

	DecodeItemIds(page, d)

	if uint64(page.PdSpecial) != common.PageSize && heap.DecodePageSpecial != nil {
		heap.DecodePageSpecial(heap, d)
	}

	// Tuples
	d.FieldArray("tuples", func(d *decode.D) {
		decodeTuples(heap, d)
	})
}