MCPcopy Index your code
hub / github.com/koding/kite / Validate

Method Validate

protocol/protocol.go:81–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79}
80
81func (k *Kite) Validate() error {
82 s := k.String()
83 if strings.Contains(s, "//") {
84 return errors.New("empty field")
85 }
86 if strings.Count(s, "/") != 7 {
87 return errors.New(`fields cannot contain "/"`)
88 }
89 return nil
90}
91
92// KiteFromString returns a new Kite string from the given string
93// representation in the form of "/username/environment/...". It's the inverse

Callers 1

TestKiteStringFunction · 0.45

Calls 1

StringMethod · 0.95

Tested by 1

TestKiteStringFunction · 0.36