What does undefined : fmt.Println(build) means in GOlang? while using "fmt.Println(len("hello world")"

go
10,309

Use fmt.Println instead of fmt.PrintLn. Make letter L lowercase.

Share:
10,309

Related videos on Youtube

Pratham Tibrewal
Author by

Pratham Tibrewal

Updated on June 04, 2022

Comments

  • Pratham Tibrewal
    Pratham Tibrewal almost 2 years

    enter image description here

    I am new to go language and programming.

    Can anyone explain what does the error means and how can I tackle it?

    • T. Claverie
      T. Claverie over 6 years
      It's fmt.Println and not fmt.PrintLn
    • Pratham Tibrewal
      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
      T. Claverie over 6 years
      As 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
      Pratham Tibrewal over 6 years
      @T.Claverie Thank you that was very helpful. i'll sure see to the Tour of Go.
  • Pratham Tibrewal
    Pratham Tibrewal over 6 years
    thank you sir. But still, can you explain the concept of undefined in go language?
  • Caleb Hensley
    Caleb Hensley about 2 years
    In this case, "undefined" implies that the fmt package doesn't define the PrintLn function. In other words, the entire call to fmt.PrintLn() is undefined. If you were able to update the fmt package to include a complete function for PrintLn, it would then be defined.