Validate validates the fields and sets the default values.
()
| 94 | |
| 95 | // Validate validates the fields and sets the default values. |
| 96 | func (m *Submodule) Validate() error { |
| 97 | if m.Path == "" { |
| 98 | return ErrModuleEmptyPath |
| 99 | } |
| 100 | |
| 101 | if m.URL == "" { |
| 102 | return ErrModuleEmptyURL |
| 103 | } |
| 104 | |
| 105 | if dotdotPath.MatchString(m.Path) { |
| 106 | return ErrModuleBadPath |
| 107 | } |
| 108 | |
| 109 | return nil |
| 110 | } |
| 111 | |
| 112 | func (m *Submodule) unmarshal(s *format.Subsection) { |
| 113 | m.raw = s |
no outgoing calls