Cursos /
Introduction to GoLang
Challenge: Basics of Variables
Task
Complete the following code so that both myVar1
and myVar2
are successfully declared and initialized.
index.go
package main
import "fmt"
func main() {
var myVar1 = 1
myVar2 := 2
fmt.Println("The value of myVar1 is", myVar1)
fmt.Println("The value of myVar2 is", myVar2)
}
¿Todo estuvo claro?
Sección 1. Capítulo 10
Contenido del Curso
Introduction to GoLang
Introduction to GoLang
Challenge: Basics of Variables
Task
Complete the following code so that both myVar1
and myVar2
are successfully declared and initialized.
index.go
package main
import "fmt"
func main() {
var myVar1 = 1
myVar2 := 2
fmt.Println("The value of myVar1 is", myVar1)
fmt.Println("The value of myVar2 is", myVar2)
}
¿Todo estuvo claro?
Sección 1. Capítulo 10