// check is invoked from the bundler's handler.
// It launches a check in a new goroutine. Any error is communicated via c.err
195532
func (c *BundlingChecker) check(items []checkerItem) {
	c.waitc <- struct{}{}
	c.wg.Add(1)
	go func() {
		c.doCheck(items)
		c.wg.Done()
		<-c.waitc
	}()

}
918979
func (g *GopathTest) Check(err error) {
	if err == nil {
		return
	}
	g.Fatal(err)
}
979106
func (c *CheckTCP) check() {
	var currentStatus string
	previousStatus := c.Status

	conn, err := c.dialer.Dial(`tcp`, c.tcp)
	if err != nil {
		logrus.Warnf("[health-check] TCP Check is failing => %s", err)
		currentStatus = BAD
	} else {
		logrus.Debugf("[health-check] TCP check on '%v' at '%s' is passing", c.DestinationID, c.tcp)
		currentStatus = OK
		conn.Close()
	}

	if currentStatus != previousStatus {
		c.Status = currentStatus
		c.updateCh <- true
	}
}
1362769
func Check(err error, checker func(error) bool) bool {
	if annotated, ok := err.(*annotatedError); ok {
		return checker(annotated.LastError())
	}
	return checker(err)
}
355615
func (ipc ImagePullCheck) Check() (warnings, errorList []error) {
	for _, image := range ipc.imageList {
		ret, err := ipc.runtime.ImageExists(image)
		if ret && err == nil {
			klog.V(1).Infof("image exists: %s", image)
			continue
		}
		if err != nil {
			errorList = append(errorList, errors.Wrapf(err, "failed to check if image %s exists", image))
		}
		klog.V(1).Infof("pulling %s", image)
		if err := ipc.runtime.PullImage(image); err != nil {
			errorList = append(errorList, errors.Wrapf(err, "failed to pull image %s", image))
		}
	}
	return warnings, errorList
}
513175
func (cd service) Check() error {
	writableErr := neoutils.CheckWritable(cd.conn)
	if writableErr != nil {
		return writableErr
	}

	return neoutils.Check(cd.conn)
}
1113289
func (tu *thresholdUpdater) Check() error {
	tu.mu.Lock()
	defer tu.mu.Unlock()

	if tu.count >= tu.threshold {
		return tu.status
	}

	return nil
}
1145344
func (ipvspc IPVSProxierCheck) Check() (warnings, errors []error) {
	ipsetInterface := utilipset.New(ipvspc.exec)
	kernelHandler := ipvs.NewLinuxKernelHandler()
	if _, err := ipvs.CanUseIPVSProxier(kernelHandler, ipsetInterface); err != nil {
		return nil, append(errors, err)
	}
	return nil, nil
}
176825
func (d *Descriptor) Check() error {
	if d.Pack < 1 || d.Pack > 4 {
		return fmt.Errorf("invalid pack value %v", d.Pack)
	}
	for i := 0; i < d.Planes; i++ {
		h := d.GetHeight(i)
		if d.Interlaced && h%2 != 0 && h != d.Height {
			return fmt.Errorf("invalid interlaced input height %v", d.Height)
		}
	}
	return nil
}
435754
func (u *UpdateChecker) Check() {
	u.updater.config.SetLastUpdateCheckTime()
	if err := u.check(); err != nil {
		u.log.Errorf("Error in update: %s", err)
	}
}
473763
func (crc ContainerRuntimeCheck) Check() (warnings, errorList []error) {
	klog.V(1).Infoln("validating the container runtime")
	if err := crc.runtime.IsRunning(); err != nil {
		errorList = append(errorList, err)
	}
	return warnings, errorList
}
1078476
func (s *ID) Check() error {
	_, err := ParseID(string(*s))
	return trace.Wrap(err)
}
333927
func (p *proofSetT) check(ctx context.Context, world LoaderContext, parallel bool) (err error) {
	defer p.G().CTrace(ctx, "TeamLoader proofSet check", func() error { return err })()

	if parallel {
		return p.checkParallel(ctx, world)
	}

	var total int
	for _, v := range p.proofs {
		total += len(v)
	}

	var i int
	for _, v := range p.proofs {
		for _, proof := range v {
			p.G().Log.CDebugf(ctx, "TeamLoader proofSet check [%v / %v]", i, total)
			err = proof.check(ctx, p.G(), world, p)
			if err != nil {
				return err
			}
			i++
		}
	}
	return nil
}
991036
func Check(auditor Auditor, action string, handle func(http.ResponseWriter, *http.Request)) http.HandlerFunc {

	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		ctx := r.Context()
		vars := mux.Vars(r)
		auditParams := audit.GetParameters(ctx, r.URL.EscapedPath(), vars)
		logData := audit.ToLogData(auditParams)

		log.DebugR(r, "checking for an identity in request context", nil)

		if err := auditor.Record(ctx, action, audit.Attempted, auditParams); err != nil {
			http.Error(w, "internal error", http.StatusInternalServerError)
			request.DrainBody(r)
			return
		}

		// just checking if an identity exists until permissions are being provided.
		if !common.IsCallerPresent(ctx) {
			log.ErrorR(r, errors.New("no identity was found in the context of this request"), logData)

			if auditErr := auditor.Record(ctx, action, audit.Unsuccessful, auditParams); auditErr != nil {
				http.Error(w, "internal error", http.StatusInternalServerError)
				request.DrainBody(r)
				return
			}

			http.Error(w, "unauthenticated request", http.StatusUnauthorized)
			request.DrainBody(r)
			return
		}

		log.DebugR(r, "identity found in request context, calling downstream handler", logData)

		// The request has been authenticated, now run the clients request
		handle(w, r)
	})
}
970797
func (f *File) Check() {
	// TODO
	typs := make(map[ast.Expr]types.TypeAndValue)
	defs := make(map[*ast.Ident]types.Object)
	uses := make(map[*ast.Ident]types.Object)
	config := types.Config{FakeImportC: true}
	config.Importer = importer.Default()
	info := &types.Info{Types: typs, Defs: defs, Uses: uses}
	astFiles := []*ast.File{f.ast}
	typesPkg, err := config.Check(fileDir(f), f.fs, astFiles, info)
	if err != nil {
		log.Fatalf("checking package: %s", err)
	}
	f.Info = info
	f.Pkg = typesPkg
}
1216920
func (u *updater) Check() error {
	u.mu.Lock()
	defer u.mu.Unlock()

	return u.status
}
1295215
func check(err error) {
	if err == nil {
		return
	}

	buildMU.Lock()
	defer buildMU.Unlock()
	build.Status = pb.Status_INFRA_FAILURE
	build.SummaryMarkdown = fmt.Sprintf("run_annotations failure: `%s`", err)
	client.WriteBuild(build)
	fmt.Fprintln(os.Stderr, err)
	os.Exit(1)
}