Undefined: fmt.Println(build) in GOlang
When you encounter the error "undefined: fmt.Println(build)", it usually indicates that you have a typo or an incorrect function call in your Go code. Specifically, it seems that you have used fmt.PrintLn
instead of fmt.Println
.
The correct syntax for fmt.Println
is:
fmt.Println(args...)Where
args
is a list of values to be printed, separated by spaces.
The error "undefined: fmt.Println(build)" occurs because there is no function named fmt.PrintLn
in the Go standard library.
To fix this error, you need to change fmt.PrintLn
to fmt.Println
. Additionally, make sure that the letter "L" in fmt.Println
is lowercase. Here's the corrected code:
package main import "fmt" func main() { fmt.Println("hello_world") }
When you run this code, it will print "hello_world" to the console without any errors.