mirror of
https://github.com/cheat/cheat.git
synced 2024-11-16 17:08:29 +01:00
e5114a3e76
- Re-implemented the project in Golang, and deprecated Python entirely - Implemented several new, long-requested features - Refactored cheatsheets into a separate repository
18 lines
324 B
Go
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
|
|
}
|