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: ordered_group.go
    path of file: ./repos/sliver/vendor/github.com/aws/smithy-go/middleware
    
    the code of the file until where you have to start completion: package middleware

import "fmt"

// RelativePosition provides specifying the relative position of a middleware
// in an ordered group.
type RelativePosition int

// Relative position for middleware in steps.
const (
	After RelativePosition = iota
	Before
)

type ider interface {
	ID() string
}

// orderedIDs 
    
func (s *relativeOrder) insert(i int, pos RelativePosition, ids ...string) error {
	switch pos {
	case Before:
		n := len(ids)
		var src []string
		if n <= cap(s.order)-len(s.order) {
			s.order = s.order[:len(s.order)+n]
			src = s.order
		} else {
			src = s.order
			s.order = make([]string, len(s.order)+n)
			copy(s.order[:i], src[:i]) // only when allocating a new slice do we need to copy the front half
		}
		copy(s.order[i+n:], src[i:])
		copy(s.order[i:], ids)
	case After:
		if i == len(s.order)-1 || len(s.order) == 0 {
			s.order = append(s.order, ids...)
		} else {
			s.order = append(s.order[:i+1], append(ids, s.order[i+1:]...)...)
		}

	default:
		return fmt.Errorf("invalid position, %v", int(pos))
	}

	return nil
}