Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Dmitry Yakimenko
Dmitry Yakimenko

Posted on

     

Giving Go another chance: setting everything up

First things first: I need to be able to build and run Go programs. I'm using
macOS, so installing Go was very quick:

$ brew install go

Seems to work:

$ go versiongo version go1.11.4 darwin/amd64

Now I need to hook it up with my editor. I'd like to have at least some basic features, like format code on save and build and run from the editor. Normally I use Sublime Text 3, but after quickly checking theinstallation instructions I decided to rather try Visual Studio Code where I can set everything up with one click.

It's been laying around on my hard drive for a while now and now I finally have an excuse to try it out. So, not only a new language, a new editor as well. Yay!

Setting up the extension took just a couple of minutes, it was quick and absolutely painless. Making the editor format the code on save, on the other hand, was a whole different story. It took me a really long time fiddling with the settings, googling, readingrelevant issues on Github and so on. VS Code was very helpful most of the time, installing relevant tools, highlighting errors in my config and so forth. The only thing it refused to do is to format my code on save.

It seems I've tried everything and I just gave up and went to bed. As it turned out next morning, all it needed is a restart. How dumb of me. I guess it's that my never dying faith in software and that developers for once will get it right. No such luck this time. At least Windows 95 was honest about this. VS Code makes it look like no restart is needed and everything is kinda working but not 100%. More like 93.76%.

In the end I have it all working: format on save, build, go to definition and even full blown IntelliSense, that autocompletes almost everything for me. Nice!

Let's get to coding next time.


This is how much I rely on Google these days to get this little bit of work done:

  • go tutorial
  • homebrew install golang
  • goimports
  • goreturns
  • goformat
  • vscode go fmt on save
  • vscode go format on save not working
  • go vet
  • go build release

Time spent: 3 hours
Total time spent: 3 hours

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Grew up in Russia, lived in the States, moved to Germany, sometimes live in Spain. I program since I was 13. I used to program games, maps and now I reverse engineer password managers and other stuff
  • Location
    Berlin and Málaga
  • Education
    MS in CS from State Polytechnic University of St. Petersburg
  • Work
    Principal Software Engineer at HERE
  • Joined

More fromDmitry Yakimenko

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp