I'm getting an error saying "undefined isvalid". How do I call another function in a function?
package main
import "fmt"
type Position struct {
row int
col int
}
func (posstn Position) isvalid() bool {
if posstn.row > 8 || posstn.row < 0 || posstn.col > 8 || posstn.col < 0 {
return false
}
return true
}
func Possmov(pos Position) {
var isval isvalid
if isval == true {
fmt.Println("Something")
}
}
func main() {
Possmov(Position{1, 7})
}