Hi,
I am new to Go but I don’t understand what’s wrong with my source code below.
I always get a message “13:6: guess declared and not used” ?!?!
Can somebody tell why?
Thanks!
Alain
package main
import (
“fmt”
“math/rand”
)
const maxNumber = 10
func main() {
var number int
var guess int
var attemps int
// Generate a random number to guess
number = rand.Intn(10) + 1
// Prompt for number to guess
guess = 2
// Congrats
fmt.Printf(“Great! You found the number %v in %v attemps!”, number, attemps)
}