GO RESTFUL — #5

Summary of a Go Full-time Local-quality VSCode-powered Containerized Development Environment

Minh-Phuc Tran
Level Up Coding
Published in
3 min readSep 11, 2019

--

Last week (last 3 articles in this series), I managed to set up a full-time local-quality VSCode-powered containerized development environment for Golang and finished this epic ticket. I’m now good to start writing some Go code. However, just before doing that, let’s make a summary of what I’ve had so far and what could be improved.

What have I got so far?

Thanks to Docker, Visual Studio Code, VS Code Remote-Containers extension, and VS Code Go extension and some of my efforts to integrate those tools, I now can:

  • Write Go code with all of IntelliSense’s features, e.g. autocompletion, auto imports, code navigation, etc.
  • Run the application without Go runtime installed on local machine. Thanks to Docker port publishing/mapping, I can test the application directly from Safari, too.
  • Use awesome debugging features.
  • Use go-dep to manage external Go packages, e.g. automatically fetching/building external packages, automatically lock version and provide consistent reproducible build, etc.

One more important thing is that I can achieve all of above with just Docker and VS Code, no additional setup required. So do newcomers, who come to the project in the future.

Everything is automatically set up!

Photo by Rock'n Roll Monkey on Unsplash

All I and my collaborators have to do to start development with all of mentioned cool features is just open the project by VS Code, everything will be automatically set up!

I wrote a detailed documentation about how to use it, too. Check out the project to see how to use it and how I implemented it. The project is free licensed so feel free to make your fork and apply it to your own projects!

It can be and should be better! Please help me if you’d love to ❤️!

Although what I’ve got so far is pretty cool and it already can save a lot of developers’ lives but there’re still issues that can be and should be better:

  • I’m not able to use Git pushes within VS Code user interface, because it requires my local SSH credentials. It should somehow automatically and safely mount my SSH credentials into dev containers. Refer to this ticket for further details.
  • I can not do GPG sign my commit within VSCode user interface, because it requires my local GPG agent. It should somehow automatically and safely forward GPG commands from dev containers to local GPG agent. Refer to this ticket for further details.
  • There’re duplicated values in the current configuration including workspaceMount, workspaceFolder, appPort in .devcontainer.json, EXPOSE in Dockerfile, --publishing option in scripts/start-devcontainer.sh. Duplication creates inconsistency and makes updating and maintaining more painful. Refer to this ticket for further details.

Check out the project, where I’ll keep making improvement during this series. It’s open-source and free licensed. So if you find it useful and you got some free time, please help collaborate with me ❤️ . We can together build something useful for us and for developers community!

See you in next article!

--

--

Software Engineer. Documenting my journey at 𝐩𝐡𝐮𝐜𝐭𝐦𝟗𝟕.𝐜𝐨𝐦