Video:

Constants in Go

May 7, 2021

Course Instructor: Elliot Forbes

Hey Gophers! My name is Elliot and I'm the creator of TutorialEdge and I've been working with Go systems for roughly 5 years now. Feel free to reach out to me on twitter - @Elliot_F

Code

package main

func main() {
	const pi = 3.14
	println(pi)

	var size float64 = 1.0
	println(size * pi)
}

Output

$ go run main.go
+3.140000e+000
+3.140000e+000