Why does the code below throw unexpected func error ? I see error ./func_correct.go:4: syntax error: unexpected func, expecting name
package main
func (st *Stack) Pop() int {
v := 0
for ix := len (st) - 1; ix >= 0; ix-- {
if v = st[ix]; v != 0 {
st[ix] = 0
return v
}
}
return 0
}
func main() {
Pop()
}