MCPcopy Create free account
hub / github.com/coder/guts / ToStrings

Function ToStrings

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

ToStrings works for any type where the base type is a string.

(a []T)

Source from the content-addressed store, hash-verified

2
3// ToStrings works for any type where the base type is a string.
4func ToStrings[T ~string](a []T) []string {
5 tmp := make([]string, 0, len(a))
6 for _, v := range a {
7 tmp = append(tmp, string(v))
8 }
9 return tmp
10}
11
12// List is a helper function to reduce boilerplate when converting slices of
13// database types to slices of codersdk types.

Callers 6

PropertySignatureMethod · 0.85
InterfaceMethod · 0.85
AliasMethod · 0.85
TypeParameterMethod · 0.85
VariableStatementMethod · 0.85
EnumDeclarationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…