MCPcopy Create free account
hub / github.com/modelcontextprotocol/go-sdk / newFeatureSet

Function newFeatureSet

mcp/features.go:31–36  ·  view source on GitHub ↗

newFeatureSet creates a new featureSet for features of type T. The argument function should return the unique ID for a single feature.

(uniqueIDFunc func(T) string)

Source from the content-addressed store, hash-verified

29// newFeatureSet creates a new featureSet for features of type T.
30// The argument function should return the unique ID for a single feature.
31func newFeatureSet[T any](uniqueIDFunc func(T) string) *featureSet[T] {
32 return &featureSet[T]{
33 uniqueID: uniqueIDFunc,
34 features: make(map[string]T),
35 }
36}
37
38// add adds each feature to the set if it is not present,
39// or replaces an existing feature.

Callers 6

NewServerFunction · 0.85
TestServerPaginateBasicFunction · 0.85
NewClientFunction · 0.85
TestFeatureSetOrderFunction · 0.85
TestFeatureSetAboveFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestServerPaginateBasicFunction · 0.68
TestFeatureSetOrderFunction · 0.68
TestFeatureSetAboveFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…