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: builder.go
    path of file: ./repos/sliver/vendor/tailscale.com/tka
    
    the code of the file until where you have to start completion: // Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause

pack
    
func (b *UpdateBuilder) generateCheckpoint() error {
	// Compute the checkpoint state.
	state := b.a.state
	for i, update := range b.out {
		var err error
		if state, err = state.applyVerifiedAUM(update); err != nil {
			return fmt.Errorf("applying update %d: %v", i, err)
		}
	}

	// Checkpoints cant specify a parent AUM.
	state.LastAUMHash = nil
	return b.mkUpdate(AUM{MessageKind: AUMCheckpoint, State: &state})
}