// check type-checks the package. The package must be OK to proceed.
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
}
125081
func checkType(name string, kind reflect.Kind, v interface{}) error {
	actualKind := reflect.TypeOf(v).Kind()
	if actualKind != kind {
		return fmt.Errorf("parameter %q value is expected to be %v, got %v",
			name, kind.String(), actualKind.String())
	}
	return nil
}
1071542
func (b *UpdateService) Type(typ string) *UpdateService {
	b.typ = typ
	return b
}
742338
func (c *accountIDOptions) Check() error {
	_, err := strkey.Decode(strkey.VersionByteAccountID, c.AccountID)
	if err != nil {
		return ErrInvalidAccountID
	}
	return nil
}
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
}
448585
func (self *Collection) Check() error {
	var merr error

	for i, field := range self.Fields {
		if field.Name == `` {
			merr = log.AppendError(merr, fmt.Errorf("collection[%s] field #%d cannot have an empty name", self.Name, i))
		}

		if ParseFieldType(string(field.Type)) == `` {
			merr = log.AppendError(merr, fmt.Errorf("collection[%s] field[%s]: invalid type %q", self.Name, field.Name, field.Type))
		}
	}

	return merr
}
164875
func (cte *ControllerTypeEvents) check(theType reflect.Type, fieldPath []int) {
	typeChecker := func(checkType reflect.Type) {
		for index := 0; index < checkType.NumMethod(); index++ {
			m := checkType.Method(index)
			// Must be two arguments, the second returns the controller type
			// Go cannot differentiate between promoted methods and
			// embedded methods, this allows the embedded method to be run
			// https://github.com/golang/go/issues/21162
			if m.Type.NumOut() == 2 && m.Type.Out(1) == checkType {
				if checkType.Kind() == reflect.Ptr {
					controllerLog.Debug("Found controller type event method pointer", "name", checkType.Elem().Name(), "methodname", m.Name)
				} else {
					controllerLog.Debug("Found controller type event method", "name", checkType.Name(), "methodname", m.Name)
				}
				controllerFieldPath := newFieldPath(checkType.Kind() == reflect.Ptr, m.Func, fieldPath)
				switch strings.ToLower(m.Name) {
				case "before":
					cte.Before = append([]*ControllerFieldPath{controllerFieldPath}, cte.Before...)
				case "after":
					cte.After = append(cte.After, controllerFieldPath)
				case "panic":
					cte.Panic = append(cte.Panic, controllerFieldPath)
				case "finally":
					cte.Finally = append(cte.Finally, controllerFieldPath)
				}
			}
		}
	}

	// Check methods of both types
	typeChecker(theType)
	typeChecker(reflect.PtrTo(theType))

	// Check for any sub controllers, ignore any pointers to controllers revel.Controller
	for i := 0; i < theType.NumField(); i++ {
		v := theType.Field(i)

		switch v.Type.Kind() {
		case reflect.Struct:
			cte.check(v.Type, append(fieldPath, i))
		}
	}
}
869597
func (s *Script) Type(typ string) *Script {
	s.typ = typ
	return s
}
350738
func sliceTypeCheck(t Type, val reflect.Value) error {
	if val.Kind() != reflect.Slice && val.Kind() != reflect.Array {
		return typeErr(formatSliceString(t.Kind, t.Size), val.Type())
	}

	if t.T == ArrayTy && val.Len() != t.Size {
		return typeErr(formatSliceString(t.Elem.Kind, t.Size), formatSliceString(val.Type().Elem().Kind(), val.Len()))
	}

	if t.Elem.T == SliceTy {
		if val.Len() > 0 {
			return sliceTypeCheck(*t.Elem, val.Index(0))
		}
	} else if t.Elem.T == ArrayTy {
		return sliceTypeCheck(*t.Elem, val.Index(0))
	}

	if elemKind := val.Type().Elem().Kind(); elemKind != t.Elem.Kind {
		return typeErr(formatSliceString(t.Elem.Kind, t.Size), val.Type())
	}
	return nil
}
610498
func (linux Linux) Type() string {
	if len(linux.lsbrelease) == 0 {
		return ""
	}

	rType := regexp.MustCompile(typePattern)
	result := rType.FindAllStringSubmatch(linux.lsbrelease, 1)[0][1]

	return strings.ToLower(result)
}
449117
func (v *Validation) Check(obj interface{}, checks ...Validator) *ValidationResult {
	var result *ValidationResult
	for _, check := range checks {
		result = v.apply(check, obj)
		if !result.Ok {
			return result
		}
	}
	return result
}
448988
func Check(d *certdata.Data) *errors.Errors {
	var e = errors.New(nil)

	switch d.Type {
	case "DV", "OV", "EV":
		if d.Cert.IsCA {
			e.Err("Certificate has set CA true")
		}
		if d.Cert.MaxPathLen == 0 && d.Cert.MaxPathLenZero {
			//e.Err("Certificate has set CA true")
		}
		if d.Cert.BasicConstraintsValid {
			//e.Err("Certificate has set CA true")
		}
	}

	return e
}
435754
func (u *UpdateChecker) Check() {
	u.updater.config.SetLastUpdateCheckTime()
	if err := u.check(); err != nil {
		u.log.Errorf("Error in update: %s", err)
	}
}
986004
func Check() {
	if strings.Contains(runtime.Version(), "1.8") {
		// Go 1.8 doesn't play along with go test ./... and /vendor.
		// We could fix that, but that would take time.
		fmt.Printf("Skip Check on %s\n", runtime.Version())
		return
	}

	mg.Deps(Test386)

	mg.Deps(Fmt, Vet)

	// don't run two tests in parallel, they saturate the CPUs anyway, and running two
	// causes memory issues in CI.
	mg.Deps(TestRace)
}
1237634
func typeCheckParameter(obj interface{}, expected string, name string) error {
	// Make sure there is an object.
	if obj == nil {
		return nil
	}

	// Check the type is as expected.
	if reflect.TypeOf(obj).String() != expected {
		return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String())
	}
	return nil
}
918979
func (g *GopathTest) Check(err error) {
	if err == nil {
		return
	}
	g.Fatal(err)
}
1171465
func (s *sqlStrConcat) checkObject(n *ast.Ident, c *gosec.Context) bool {
	if n.Obj != nil {
		return n.Obj.Kind != ast.Var && n.Obj.Kind != ast.Fun
	}

	// Try to resolve unresolved identifiers using other files in same package
	for _, file := range c.PkgFiles {
		if node, ok := file.Scope.Objects[n.String()]; ok {
			return node.Kind != ast.Var && node.Kind != ast.Fun
		}
	}
	return false
}