cheat/internal/cheatpath/validate.go
Chris Lane e5114a3e76 Re-wrote from scratch in Golang
- Re-implemented the project in Golang, and deprecated Python entirely
- Implemented several new, long-requested features
- Refactored cheatsheets into a separate repository
2019-10-20 10:02:28 -04:00

18 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
}