mirror of
https://github.com/cheat/cheat.git
synced 2024-11-22 05:51:35 +01:00
19 lines
324 B
Go
19 lines
324 B
Go
|
package cheatpath
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
// Validate returns an error if the cheatpath is invalid
|
||
|
func (c *Cheatpath) Validate() error {
|
||
|
|
||
|
if c.Name == "" {
|
||
|
return fmt.Errorf("invalid cheatpath: name must be specified")
|
||
|
}
|
||
|
if c.Path == "" {
|
||
|
return fmt.Errorf("invalid cheatpath: path must be specified")
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|