title: Executing function upon required number of times
body: <p>calculate the sum of squares of given integers, excluding any negatives.
  The first line of the input will be an integer N (1 &lt;= N &lt;= 100), indicating the number of test cases to follow.
  Each of the test cases will consist of a line with an integer X (0 &lt; X &lt;= 100), followed by another line consisting of X number of space-separated integers Yn (-100 &lt;= Yn &lt;= 100).
  For each test case, calculate the sum of squares of the integers, excluding any negatives, and print the calculated sum in the output.</p>
  
  <p>Note: There should be no output until all the input has been received.
  Note 2: Do not put blank lines between test cases solutions.
  Note 3: Take input from standard input, and output to standard output.</p>
  
  <p>Rules
  Write your solution using Go Programming Language
  Your source code must be a single file (package main)
  Do not use any for statement
  You may only use standard library packages</p>
  
  <p><strong>"Problem which I am facing"</strong>
  'square' function below is not getting executed the required number of times according to the input test cases. To meet specific requirements I wasn't allowed to use the 'for' statement. Please help me out. Language is Go. </p>
  
  <pre><code>package main
  
  import "fmt"
  
  var s []int
  
  func square(l int) {
      i := 0
      sum := 0
  Square:
  
      if l &gt; 0 {
          s[i] = s[i] * s[i]
          sum = sum + s[i]
          i++
          l--
          goto Square
  
      }
      fmt.Println(sum)
  
  }
  
  func myfunc(a int) {
  Here:
      if a &gt; 0 {
          var b int
          fmt.Scanln(&amp;b)
          if b &gt; 0 {
              s = append(s, b)
          }
          a--
          goto Here
      }
  
  }
  
  func main() {
      var a int
      fmt.Scanln(&amp;a)
  TestCases:
      if a &gt; 0 {
          var T int
          fmt.Scanln(&amp;T)
          myfunc(T)
          a--
          goto TestCases
      }
      square(len(s))
  }
  </code></pre>