MCPcopy Create free account
hub / github.com/bracesdev/errtrace / setOf

Function setOf

cmd/errtrace/main.go:1162–1172  ·  view source on GitHub ↗
(xs []T)

Source from the content-addressed store, hash-verified

1160}
1161
1162func setOf[T comparable](xs []T) map[T]struct{} {
1163 if len(xs) == 0 {
1164 return nil
1165 }
1166
1167 set := make(map[T]struct{})
1168 for _, x := range xs {
1169 set[x] = struct{}{}
1170 }
1171 return set
1172}
1173
1174var _errtraceSkip = regexp.MustCompile(`(^| )//errtrace:skip($|[ \(])`)
1175

Callers 1

funcTypeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected