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: check.go
    path of file: ./repos/fabio/vendor/github.com/circonus-labs/circonus-gometrics/v3/checkmgr
    
    the code of the file until where you have to start completion: // Copyright 2016 Circonus, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package checkmgr

import (
	"crypto/rand"
	"crypto/sha256"
	"encoding/hex"
	"fmt"
	"net/url"
	"strconv"
	"strings"
	"time"

	"github.com/circonus-labs/go-apiclient"
	"github.com/circonus-labs/go-apiclient/config"
	"github.com/pkg/errors"
)

// UpdateCheck determines if the check needs to be updated (new metrics, tags, etc.)
func (cm *CheckManager) UpdateCheck(newMetrics map[string]*apiclient.CheckBundleMetric) {
	// only if check manager is enabled
	if !cm.enabled {
		return
	}

	// only if checkBundle has been populated
	if cm.checkBundle == nil {
		return
	}

	/
    
func (cm *CheckManager) checkBundleSearch(searchCriteria string, filterCriteria map[string][]string) (*apiclient.CheckBundle, error) {
	search := apiclient.SearchQueryType(searchCriteria)
	filter := apiclient.SearchFilterType(filterCriteria)
	checkBundles, err := cm.apih.SearchCheckBundles(&search, &filter)
	if err != nil {
		return nil, err
	}

	if len(*checkBundles) == 0 {
		return nil, nil // trigger creation of a new check
	}

	numActive := 0
	checkID := -1

	for idx, check := range *checkBundles {
		if check.Status == statusActive {
			numActive++
			checkID = idx
		}
	}

	if numActive > 1 {
		return nil, errors.Errorf("multiple check bundles match criteria - search(%v) filter(%v)", searchCriteria, filterCriteria)
	}

	bundle := (*checkBundles)[checkID]

	return &bundle, nil
}