You can use the math.Pi constant from the standard library math package to get the pi(π) value in Golang. The math.Pi constant returns the 3.141592653589793, which is the float64 value.
package main
import (
"fmt"
"math"
)
func main() {
pi := math.Pi
fmt.Println(pi)
}
Output
3.141592653589793
This value is only an approximation of pi and may not be precise to all decimal places.
Conclusion
The Pi is a built-in Go constant of the math package used to get the value of the mathematical constant π. It is defined in Euclidean geometry as the ratio of a circle’s circumference to its diameter and also has various equivalent definitions.

Krunal Lathiya is a Software Engineer with over eight years of experience. He has developed a strong foundation in computer science principles and a passion for problem-solving. In addition, Krunal has excellent knowledge of Distributed and cloud computing and is an expert in Go Language.