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: hooks.go
    path of file: ./repos/stash/pkg/txn
    
    the code of the file until where you have to start completion: package txn

import (
	"context"
)

type key int

const (
	hookManagerKey key = iota + 1
)

type hookManager struct {
	preCommitHooks    []TxnFunc
	postCommitHook
    
func executeHooks(ctx context.Context, hooks []TxnFunc) error {
	// we need to return the first error
	for _, h := range hooks {
		if err := h(ctx); err != nil {
			return err
		}
	}

	return nil
}