MCPcopy
hub / github.com/sqldef/sqldef / TransformSlice

Function TransformSlice

util/util.go:10–16  ·  view source on GitHub ↗

TransformSlice applies the converter to each element in the input slice and returns a new slice.

(in []T, converter func(T) R)

Source from the content-addressed store, hash-verified

8
9// TransformSlice applies the converter to each element in the input slice and returns a new slice.
10func TransformSlice[T any, R any](in []T, converter func(T) R) []R {
11 out := make([]R, len(in))
12 for i, v := range in {
13 out[i] = converter(v)
14 }
15 return out
16}
17
18// CanonicalMapIter returns an iterator that yields map entries in sorted key order.
19// This ensures deterministic iteration over maps, which is useful for generating

Callers 14

ParseFilesFunction · 0.92
parseConstraintMethod · 0.92
parseForeignKeyMethod · 0.92
formatTriggerEventMethod · 0.92
escapeAndJoinNamesMethod · 0.92
areSameEventsFunction · 0.92
normalizeCheckExprFunction · 0.92
normalizeExprFunction · 0.92
parseDDLFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected