After using Heroku for many years, I’ve recently taken a look into Railway as an alternative hosting platform for various side projects. These projects are often written in Go (of course!) so I thought I’d write a quick guide on how to setup a new project - the good news is, it’s easy!
1) Get an Account
It’s easy to setup, the link on their home page will help you.
You may need to add sensitive information to your project as ‘Variables’. Again, these work in a similar way to our hosting platforms like Heroku. You access them by opening your project, clicking on the web process, and selecting the Variables tab.
Edd is a PHP and Go developer who enjoys blogging about his experiences, mostly about creating and coding new things he's working on and is a big beliver in open-source and Linux.
Change Go Version in Mod
–
Picking up an old Go project, we wanted to update the desired version it should run on (mainly so when we deployed to our live systems it would use this version too). To do this, we updated the version within the go.mod file - the file which keeps track of both versions and packages used by the project.
We used the command below:
How to Die Dump in Go - dd()
–
Having come from the PHP community, we often have a handy debug function at our disposal dd() (part of Laravel) and var_dump() (native). This may not be perfect (compared with a full on debugging suite) but it is a quick and easy debugging method. This post gives an idea on how you can do the same, but in Go.
We’re helped out by being able to use both variable parameters (shown with .
Docker Setup for Go Development
–
This is a short and sweet article on running a Go application using Docker. This is a generic example and many use-cases will differ and so have totally different setups. In our examples we’re also using Docker and docker-compose both of which you will need already installed and setup on your machine for this to work.