I posses great passion in technologies that help to improve better living. I have a deep interest in working in the field of technical evangelism.
Author of Iris web framework.
Location
Greece
Education
International Hellenic University
Work
Back End Go Engineer at PNOĒ | https://www.pnoe.com
Hello @muhimen123
, in Go(lang) you can reduce the loc. import "fmt" is not required, you could just use the print/println as you do with the rest of the hello-worlds. You can replace the code snippet with:
packagemainfuncmain(){println("Hello, World!")}
Good article though :) It was fun, reminds me old times
Oliver Leaver-Smith, better known as ols, is a distinguished technologist whose topics of expertise include OpenBSD, automation, chaos and resilience engineering, and Nerf warfare.
Location
Sheffield, UK
Work
Senior Platform Engineer at Sky Betting and Gaming
Oliver Leaver-Smith, better known as ols, is a distinguished technologist whose topics of expertise include OpenBSD, automation, chaos and resilience engineering, and Nerf warfare.
Location
Sheffield, UK
Work
Senior Platform Engineer at Sky Betting and Gaming
But remember, according to the documentation print() and println() are built-in functions for bootstrapping and not guaranteed to stay in the language.
Oliver Leaver-Smith, better known as ols, is a distinguished technologist whose topics of expertise include OpenBSD, automation, chaos and resilience engineering, and Nerf warfare.
Location
Sheffield, UK
Work
Senior Platform Engineer at Sky Betting and Gaming
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
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello @muhimen123 , in Go(lang) you can reduce the loc.
import "fmt"
is not required, you could just use theprint/println
as you do with the rest of the hello-worlds. You can replace the code snippet with:Good article though :) It was fun, reminds me old times
Thanks. Changing the code right now!
@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
Something like this?
Yep, perfect
But remember, according to the documentation print() and println() are built-in functions for bootstrapping and not guaranteed to stay in the language.
Yes you are correct. If we want to be pedantic I would say the original post, which had
import "fmt"
in and usedfmt.Println
is better thanprintln()
but this post seems to be an exercise in "Hello, World! Code Golf" so not too fussed about it