mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

Refactor config into its own package. Trying to tease the config from the server so that all of the control surfaces are exposed in the Server for easier testing.
17 lines
405 B
Go
17 lines
405 B
Go
package string
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// TrimSplit slices s into all substrings separated by sep and returns a
|
|
// slice of the substrings between the separator with all leading and trailing
|
|
// white space removed, as defined by Unicode.
|
|
func TrimSplit(s, sep string) []string {
|
|
trimmed := strings.Split(s, sep)
|
|
for i := range trimmed {
|
|
trimmed[i] = strings.TrimSpace(trimmed[i])
|
|
}
|
|
return trimmed
|
|
}
|