-3

The compiler is saying that every variable that has been defined is being defined again 5 lines later and pulling up an error, off course i haven't redefined all my variables 5 lines later, how do i stop this bug? this an example of one of the structs

type Holder struct {
    Name  string
    Holders_need int
    Avail int
}

it is claiming that there is redifend on like 32 which is the line after the struct closes I HAVE FOUND THE ANSWER TO THIS

alice w
  • 1
  • 3
  • You have declared them previously, the compiler does not make up such errors to make fun of you. Post more of your code, aim for an [MCVE](http://stackoverflow.com/help/mcve). – icza Jul 14 '16 at 11:31

2 Answers2

0

You should add some code and let us know exactly what you are doing.

You are probably using := instead of = after initializing a variable. E.g.

i := 1
// use i
i = 2 // change value of i using = since i has already been declared
// i := 2 throws error 'no new variables on left side of :='
// since i was already created above

For more details, refer here

abhink
  • 8,740
  • 1
  • 36
  • 48
0

I have found the answer to my question thank you to those who tried to help, if anyone else has this problem check that your compiler isn't attempting to compiler the same program twice, as that is what was happening here!

alice w
  • 1
  • 3