// needScan reports whether a value of the type needs to be scanned
// recursively because it may contain pointers.
555668
func (tc *typCache) needScan(typ reflect.Type) bool {
	return tc.info(typ).needScan
}
1031113
func NeedsGC(storage storage.Storer, options GCOptions) (
	doPackRefs bool, numLooseRefs int, doPruneLoose, doObjectRepack bool,
	numObjectPacks int, err error) {
	numLooseRefs, err = storage.CountLooseRefs()
	if err != nil {
		return false, 0, false, false, 0, err
	}

	doPackRefs = numLooseRefs > options.MaxLooseRefs

	if options.PruneMinLooseObjects >= 0 {
		los, ok := storage.(storer.LooseObjectStorer)
		if !ok {
			panic("storage is unexpectedly not a LooseObjectStorer")
		}

		// Count the number of loose objects that are older than the
		// expire time, to see if pruning is needed.
		numLooseMaybePrune := 0
		err = los.ForEachObjectHash(func(h plumbing.Hash) error {
			t, err := los.LooseObjectTime(h)
			if err != nil {
				return err
			}
			if t.Before(options.PruneExpireTime) {
				numLooseMaybePrune++
				if numLooseMaybePrune >= options.PruneMinLooseObjects {
					doPruneLoose = true
					return storer.ErrStop
				}
			}
			return nil
		})
		if err != nil {
			return false, 0, false, false, 0, err
		}
	}

	pos, ok := storage.(storer.PackedObjectStorer)
	if !ok {
		panic("storage is unexpectedly not a PackedObjectStorer")
	}

	packs, err := pos.ObjectPacks()
	if err != nil {
		return false, 0, false, false, 0, err
	}
	numObjectPacks = len(packs)
	doObjectRepack = options.MaxObjectPacks >= 0 &&
		numObjectPacks > options.MaxObjectPacks

	return doPackRefs, numLooseRefs, doPruneLoose,
		doObjectRepack, numObjectPacks, nil
}
845903
func (c *Cmd) StderrScanner() (*bufio.Scanner, error) {
	c.stderrPipe = true
	r, err := c.Cmd.StderrPipe()
	if c.StderrEnc != nil {
		if err != nil {
			return nil, err
		}
		return bufio.NewScanner(transform.NewReader(r, c.StderrEnc)), nil
	}
	return bufio.NewScanner(r), nil
}
508531
func (dst *Int4) Scan(src interface{}) error {
	if src == nil {
		*dst = Int4{Status: Null}
		return nil
	}

	switch src := src.(type) {
	case int64:
		if src < math.MinInt32 {
			return errors.Errorf("%d is greater than maximum value for Int4", src)
		}
		if src > math.MaxInt32 {
			return errors.Errorf("%d is greater than maximum value for Int4", src)
		}
		*dst = Int4{Int: int32(src), Status: Present}
		return nil
	case string:
		return dst.DecodeText(nil, []byte(src))
	case []byte:
		srcCopy := make([]byte, len(src))
		copy(srcCopy, src)
		return dst.DecodeText(nil, srcCopy)
	}

	return errors.Errorf("cannot scan %T", src)
}
1196394
func requireUnpackKind(v reflect.Value, t reflect.Type, k reflect.Kind,
	args Arguments) error {

	switch k {
	case reflect.Struct:
	case reflect.Slice, reflect.Array:
		if minLen := args.LengthNonIndexed(); v.Len() < minLen {
			return fmt.Errorf("abi: insufficient number of elements in the list/array for unpack, want %d, got %d",
				minLen, v.Len())
		}
	default:
		return fmt.Errorf("abi: cannot unmarshal tuple into %v", t)
	}
	return nil
}
1053010
func (g *PCPGaugeVector) MustInc(inc float64, instance string) {
	if err := g.Inc(inc, instance); err != nil {
		panic(err)
	}
}
1257150
func NeedFrame(name string) bool {
	_, ok := noFrameWindowFuncs[strings.ToLower(name)]
	return !ok
}
498206
func needsEscape(i int, b byte) bool {
	// Escape everything that is not a-z-A-Z-0-9
	// Also escape 0-9 if it's the first character
	return strings.IndexByte(alphanum, b) == -1 ||
		(i == 0 && strings.IndexByte(num, b) != -1)
}
181153
func baseScan(ctx context.Context, table []byte,
	options ...func(Call) error) (*Scan, error) {
	s := &Scan{
		base: base{
			table:    table,
			ctx:      ctx,
			resultch: make(chan RPCResult, 1),
		},
		baseQuery:     newBaseQuery(),
		scannerID:     math.MaxUint64,
		maxResultSize: DefaultMaxResultSize,
		numberOfRows:  DefaultNumberOfRows,
		reversed:      false,
	}
	err := applyOptions(s, options...)
	if err != nil {
		return nil, err
	}
	return s, nil
}
1182499
func (n *nessusImpl) StartScan(scanID int64) (string, error) {
	if n.verbose {
		log.Println("Starting scan...")
	}

	resp, err := n.doRequest("POST", fmt.Sprintf("/scans/%d/launch", scanID), nil, []int{http.StatusOK})
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()
	reply := &startScanResp{}
	if err = json.NewDecoder(resp.Body).Decode(&reply); err != nil {
		return "", err
	}
	return reply.UUID, nil
}
103463
func (g *Geometry) Scan(value interface{}) error {
	var data []byte

	switch value.(type) {
	case string:
		data = []byte(value.(string))
	case []byte:
		data = value.([]byte)
	default:
		return errors.New("unable to parse this type into geojson")
	}

	return g.UnmarshalJSON(data)
}
866292
func (r ComponentReferences) NeedsSource() (refs ComponentReferences) {
	return r.filter(func(ref ComponentReference) bool {
		return ref.NeedsSource()
	})
}
1353521
func Must(g *Geometry, err error) *Geometry {
	if err != nil {
		panic(err)
	}
	return g
}
723896
func (i *Int) Scan(src interface{}) error {
	b, ok := src.([]byte)
	if !ok {
		return errors.New("Scan source was not []byte")
	}
	str := string(b)
	*i = strToInt(str)
	return nil
}
1053257
func pemScanner(reader io.Reader) *bufio.Scanner {
	scanner := bufio.NewScanner(reader)

	scanner.Split(func(data []byte, atEOF bool) (int, []byte, error) {
		block, rest := pem.Decode(data)
		if block != nil {
			size := len(data) - len(rest)
			return size, data[:size], nil
		}

		return 0, nil, nil
	})

	return scanner
}
1282582
func Must(def Definition, err error) Definition {
	if err != nil {
		panic(err)
	}
	return def
}
723520
func isScannable(t reflect.Type) bool {
	if reflect.PtrTo(t).Implements(_scannerInterface) {
		return true
	}
	if t.Kind() != reflect.Struct {
		return true
	}

	// it's not important that we use the right mapper for this particular object,
	// we're only concerned on how many exported fields this struct has
	m := mapper()
	if len(m.TypeMap(t).Index) == 0 {
		return true
	}
	return false
}