DEV Community

Discussion on: "Hello, World!" but in 30 different languages!!!

Collapse
 
muhimen123 profile image
Muhimen

Thanks. Changing the code right now!

Collapse
 
heyitsols profile image
Oliver Leaver-Smith

@muhimen123 you need to change the fmt.Println line to just println, as you are still trying to use fmt, but not importing it any more

Thread Thread
 
muhimen123 profile image
Muhimen

Something like this?

package main 
func main() { 
    println("Hello, World!") 
} 
Thread Thread
 
heyitsols profile image
Oliver Leaver-Smith

Yep, perfect

Thread Thread
 
petergloor profile image
Peter Gloor

But remember, according to the documentation print() and println() are built-in functions for bootstrapping and not guaranteed to stay in the language.

Thread Thread
 
heyitsols profile image
Oliver Leaver-Smith

Yes you are correct. If we want to be pedantic I would say the original post, which had import "fmt" in and used fmt.Println is better than println() but this post seems to be an exercise in "Hello, World! Code Golf" so not too fussed about it