Go has two basic assignment operators "=" and ":=".
The first is a straight assignment, which requires that the variable on the left hand side already exists.
The second declares the variable, and gives it a value.
If you use the first form without declaring the variable first, you will get an "undefined: <variable name>" compiler error.
So this:
diff := spn - sv
fails because
sv
is undefined.
And the Go "is not equal to" operation is not "!==" but "!=" so change this line as well:
if (c % 2 !==0) {
But ... modulus is not defined for floating point values, so you'll get an error for that as well ...
How To Convert Data Types in Go | DigitalOcean[
^]
And so on. Read the error message, look at the line, it should be pretty obvious! Fix it and compile again. Repeat until you get a clean compile!