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: nmstate.go
    path of file: ./repos/nmstate/rust/src/go/nmstate
    
    the code of the file until where you have to start completion: package nmstate

// #cgo CFLAGS: -g -Wall
// #cgo LDFLAGS: -lnmstate
// #include <nmstate.h>
// #include <stdlib.h>
import "C"
import (
	"fmt"
	"io"
	"time"
)

type Nmstate struct {
	timeout    uint
	logsWriter io.Writer
	flags      byte
}

const (
	kernelOnly = 2 << iota
	noVerify
	includeStatusData
	includeSecrets
	noCommit
	memoryOnly
	runningConfigOnly
)

func New(options ...func(*Nmstate)) *Nmstate {
	nms := 
    
func (n *Nmstate) RollbackCheckpoint(checkpoint string) (string, error) {
	var (
		c_checkpoint *C.char
		log          *C.char
		err_kind     *C.char
		err_msg      *C.char
	)
	c_checkpoint = C.CString(checkpoint)
	rc := C.nmstate_checkpoint_rollback(c_checkpoint, &log, &err_kind, &err_msg)

	defer func() {
		C.nmstate_cstring_free(c_checkpoint)
		C.nmstate_cstring_free(err_msg)
		C.nmstate_cstring_free(err_kind)
		C.nmstate_cstring_free(log)
	}()
	if rc != 0 {
		return "", fmt.Errorf("failed when doing rollback checkpoint %s with rc: %d, err_msg: %s, err_kind: %s", checkpoint, rc, C.GoString(err_msg), C.GoString(err_kind))
	}
	if err := n.writeLog(log); err != nil {
		return "", fmt.Errorf("failed when doing rollback: %v", err)
	}
	return checkpoint, nil
}