title: How to call a function inside another function in Go language?
body: <p>I'm getting an error saying "undefined isvalid". How do I call another function in a function?</p>
  
  <pre class="lang-golang prettyprint-override"><code>package main
  
  import "fmt"
  
  type Position struct {
      row int
      col int
  }
  
  func (posstn Position) isvalid() bool {
      if posstn.row &gt; 8 || posstn.row &lt; 0 || posstn.col &gt; 8 || posstn.col &lt; 0 {
          return false
      }
      return true
  }
  
  func Possmov(pos Position) {
      var isval isvalid
      if isval == true {
          fmt.Println("Something")
      }
  }
  
  func main() {
      Possmov(Position{1, 7})
  }
  </code></pre>