MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / parseStringSlice

Function parseStringSlice

env/parsers.go:73–80  ·  view source on GitHub ↗

parseStringSlice parses a comma-separated list of strings, trimming whitespace from each element.

(env string)

Source from the content-addressed store, hash-verified

71
72// parseStringSlice parses a comma-separated list of strings, trimming whitespace from each element.
73func parseStringSlice(env string) ([]string, error) {
74 parts := strings.Split(env, ",")
75 result := make([]string, len(parts))
76 for i, p := range parts {
77 result[i] = strings.TrimSpace(p)
78 }
79 return result, nil
80}
81
82// parseStringSliceSep returns a parser that splits by a custom separator.
83// The separator is obtained from the provided StringVar descriptor.

Callers

nothing calls this directly

Calls 1

SplitMethod · 0.80

Tested by

no test coverage detected