Hacker News new | past | comments | ask | show | jobs | submit login

That used to be how you started a go project. Unfortunately, modern Go requires you to first setup a go.mod file with:

    go mod init <project name>
Still simple but for better or worse it's now a necessary part of the process.



You can still do

    go run main.go
So no need to init a package if you are just using the stdlib and you’re in a hurry.


I didn't know that. That's genuinely useful to know.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: