Fundamentals4 / 10
Up next

var and :=

package main

import "fmt"

func main() {
	// explicit declaration with a type
	var name string = "Ada"
	// short declaration infers the type
	age := 36
	fmt.Println(name, "is", age)
}
What you're solving

explicit var vs short declaration