What does undefined : fmt.Println(build) means in GOlang? while using "fmt.Println(len("hello world")"
10,309
Use fmt.Println
instead of fmt.PrintLn
. Make letter L lowercase.
Related videos on Youtube
Author by
Pratham Tibrewal
Updated on June 04, 2022Comments
-
Pratham Tibrewal almost 2 years
I am new to go language and programming.
Can anyone explain what does the error means and how can I tackle it?
-
T. Claverie over 6 yearsIt's fmt.Println and not fmt.PrintLn
-
Pratham Tibrewal over 6 years@T.Claverie Thank you, that got my program running. But still, can you explain what undefined means in go language? I don't really get the concept
-
T. Claverie over 6 yearsAs its name suggest, something that is undefined is something that has not been defined before. In programming, you will only manipulate things that have been defined previously. Wether they are variables, functions, types, anything. Usually, when the error is that something is 'undefined' it means you have a typo in a function/variable. In order to get used to programming ang to the Go language, I advise you to take the Tour of Go (tour.golang.org/welcome/1) to have your first steps in this world. This tutorial is very accessible and covers lots of important concepts.
-
Pratham Tibrewal over 6 years@T.Claverie Thank you that was very helpful. i'll sure see to the Tour of Go.
-
-
Pratham Tibrewal over 6 yearsthank you sir. But still, can you explain the concept of undefined in go language?
-
Caleb Hensley about 2 yearsIn this case, "undefined" implies that the
fmt
package doesn't define thePrintLn
function. In other words, the entire call tofmt.PrintLn()
is undefined. If you were able to update thefmt
package to include a complete function forPrintLn
, it would then be defined.