MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / stringSlice

Function stringSlice

skills/runtime.go:102–123  ·  view source on GitHub ↗
(raw any)

Source from the content-addressed store, hash-verified

100}
101
102func stringSlice(raw any) []string {
103 switch values := raw.(type) {
104 case []string:
105 out := make([]string, 0, len(values))
106 for _, value := range values {
107 if text := strings.TrimSpace(value); text != "" {
108 out = append(out, text)
109 }
110 }
111 return out
112 case []any:
113 out := make([]string, 0, len(values))
114 for _, value := range values {
115 if text := strings.TrimSpace(fmt.Sprint(value)); text != "" {
116 out = append(out, text)
117 }
118 }
119 return out
120 default:
121 return nil
122 }
123}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected