// GroundPrefix returns the ground portion of the ref starting from the head. By
// definition, the head of the reference is always ground.
774795
func (ref Ref) GroundPrefix() Ref {
	prefix := make(Ref, 0, len(ref))

	for i, x := range ref {
		if i > 0 && !x.IsGround() {
			break
		}
		prefix = append(prefix, x)
	}

	return prefix
}
557080
func (s *LifecycleRule) SetPrefix(v string) *LifecycleRule {
	s.Prefix = &v
	return s
}
694042
func WithPrefix(ctx context.Context, prefix string) context.Context {
	return context.WithValue(ctx, ctxKeyPrefix, prefix)
}
187324
func (s *InventoryS3BucketDestination) SetPrefix(v string) *InventoryS3BucketDestination {
	s.Prefix = &v
	return s
}
1194022
func (ns *Namespace) TrimPrefix(prefix, s interface{}) (string, error) {
	ss, err := cast.ToStringE(s)
	if err != nil {
		return "", err
	}

	sx, err := cast.ToStringE(prefix)
	if err != nil {
		return "", err
	}

	return _strings.TrimPrefix(ss, sx), nil
}
870011
func (c *Client) SemaphorePrefix(prefix string, limit int) (*Semaphore, error) {
	opts := &SemaphoreOptions{
		Prefix: prefix,
		Limit:  limit,
	}
	return c.SemaphoreOpts(opts)
}
540960
func (s *ListObjectsV2Output) SetPrefix(v string) *ListObjectsV2Output {
	s.Prefix = &v
	return s
}
1335972
func (s *ExtendedS3DestinationUpdate) SetPrefix(v string) *ExtendedS3DestinationUpdate {
	s.Prefix = &v
	return s
}
166929
func (a *ErrorList) AppendWithPrefix(err error, prefix string) {
	switch err := err.(type) {
	case ErrorList:
		for i := range err {
			*a = append(*a, fmt.Errorf("%s%s", prefix, err[i]))
		}
	default:
		*a = append(*a, fmt.Errorf("%s%s", prefix, err))
	}
}
103317
func commonPrefix(l, r []string) []string {
	var i int
	for i = 0; i < len(l) && i < len(r); i++ {
		if l[i] != r[i] {
			break
		}
	}
	return l[:i]
}
162709
func AddPrefix(path string) string {
	if !strings.HasPrefix(path, Prefix) {
		path = Prefix + path
	}
	return path
}
620350
func (s *S3Resource) SetPrefix(v string) *S3Resource {
	s.Prefix = &v
	return s
}
491307
func Ref(ref interface{}) interface{} {
	switch v := ref.(type) {
	case NamedResource:
		ref = v.Name
	}
	return map[string]interface{}{"Ref": ref}
}
501227
func (b *Box) WalkPrefix(prefix string, wf WalkFunc) error {
	ipref := resolver.OsPath(prefix)
	return b.Walk(func(path string, f File) error {
		ipath := resolver.OsPath(path)
		if strings.HasPrefix(ipath, ipref) {
			if err := wf(path, f); err != nil {
				return err
			}
		}
		return nil
	})
}
6698
func (node *Element) namespacePrefix(uri string) string {
	for _, ns := range node.namespaces {
		if ns.Uri == uri {
			return ns.Prefix
		}
	}
	if node.parent == nil {
		return ""
	}
	return node.parent.namespacePrefix(uri)
}
641261
func (s *S3DestinationUpdate) SetPrefix(v string) *S3DestinationUpdate {
	s.Prefix = &v
	return s
}
619566
func (s *AnalyticsS3BucketDestination) SetPrefix(v string) *AnalyticsS3BucketDestination {
	s.Prefix = &v
	return s
}