MCPcopy Index your code
hub / github.com/DarthSim/overmind / parseColors

Method parseColors

start/handler.go:88–104  ·  view source on GitHub ↗
(colorsStr string)

Source from the content-addressed store, hash-verified

86}
87
88func (h *Handler) parseColors(colorsStr string) error {
89 if len(colorsStr) > 0 {
90 colors := strings.Split(colorsStr, ",")
91
92 h.Colors = make([]int, len(colors))
93
94 for i, s := range colors {
95 color, err := strconv.Atoi(strings.TrimSpace(s))
96 if err != nil || color < 0 || color > 255 {
97 return fmt.Errorf("Invalid xterm color code: %s", s)
98 }
99 h.Colors[i] = color
100 }
101 }
102
103 return nil
104}
105
106func (h *Handler) parseFormation(formation string) error {
107 if len(formation) > 0 {

Callers 1

RunMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected