MCPcopy
hub / github.com/SleepingBag945/dddd / ToStringNSlice

Function ToStringNSlice

lib/nuclei/pkg/types/interfaces.go:83–94  ·  view source on GitHub ↗

ToStringNSlice converts an interface to string in a quick way or to a slice with strings if the input is a slice of interfaces.

(data interface{})

Source from the content-addressed store, hash-verified

81// ToStringNSlice converts an interface to string in a quick way or to a slice with strings
82// if the input is a slice of interfaces.
83func ToStringNSlice(data interface{}) interface{} {
84 switch s := data.(type) {
85 case []interface{}:
86 var a []string
87 for _, v := range s {
88 a = append(a, ToString(v))
89 }
90 return a
91 default:
92 return ToString(data)
93 }
94}
95
96func ToHexOrString(data interface{}) string {
97 switch s := data.(type) {

Callers

nothing calls this directly

Calls 1

ToStringFunction · 0.70

Tested by

no test coverage detected