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: util.go
    path of file: ./repos/rill/runtime/resolvers
    
    the code of the file until where you have to start completion: package resolvers

import (
	"slices"
	"strings"

	runtimev1 "github.com/rilldata/rill/proto/gen/rill/runtime/v1"
)

// normalizeRefs sorts and deduplicates the given refs.
// It modifies the input slice in place and retur
    
func normalizeRefs(refs []*runtimev1.ResourceName) []*runtimev1.ResourceName {
	// Sort
	slices.SortFunc(refs, func(a, b *runtimev1.ResourceName) int {
		if a.Kind != b.Kind {
			return strings.Compare(a.Kind, b.Kind)
		}
		return strings.Compare(a.Name, b.Name)
	})

	// Compact
	return slices.CompactFunc(refs, func(a, b *runtimev1.ResourceName) bool {
		return a.Kind == b.Kind && a.Name == b.Name
	})
}