Skip to content

tour: [undefined: math.pi] #1761

@XAOc57

Description

@XAOc57

Context: https://go.dev/tour/basics/3

There is some code on the page:

package main

import (
	"fmt"
	"math"
)

func main() {
	fmt.Println(math.pi)
}

And when we run this code we get the error:

./prog.go:9:19: undefined: math.pi (but have Pi)

Because the correct line is: fmt.Println(math.Pi)
After fixing the line we got this code, which works correctly::

package main

import (
	"fmt"
	"math"
)

func main() {
	fmt.Println(math.Pi)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions