Perform sum of squared numbers without using for loop
There is a base case... it's the line if x &gt; 0 {
compare to the for loop version
for x=input: x&gt;0: x=x-1 {
findSquareSum(input,a,x) sets x=input
if x &gt; 0 { is the condition check
findSquareSum(x-1, a, iteration) decrements x
also consider the modified fucntion
func findSquareSum(x int, a []int, iteration int) {
    var num int
    if x &lt;= 0 { return }
        
    fmt.Scanf(&quot;%d&quot;, &amp;num)
    if num &gt; 0 {
        a[iteration-1] += num * num
    }
    findSquareSum(x-1, a, iteration)
}

now it should look more like the base cases we are to seeing. It should also be clear that this is equivalent to the askers version (unless my go syntax is wrong!)
similarly
func readTest(x int, a []int){
    var input int
    if x &lt;= 0 { return }
    fmt.Scanf(&quot;%d&quot;, &amp;input)
    findSquareSum(input,a,x)
    readTest(x-1,a)
}