Configuration

Night mode

Create Project

A$AP Scalable Web Services with Go & Docker 🚀 Course

Engineers From These Top Companies and Universities Trust EXLskills

1M+ Professionals | 100+ Institutions

This is the EXLskills free and open-source A$AP Scalable Web Services with Go & Docker Course! It's a highly-accelerated open course that's best-suited for people with a bit of background in software engineering to quickly pick up Go, learn the essential best practices, and hit the ground running!
After this course, you'll be able to build lightweight, scalable, and idiomatic web services that connect to relational (SQL) databases, consider auth, and serve performant JSON REST APIs.
For further practice, we recommend checking out our Go Guided Projects that will give you access to a professional Go developer, detailed documentation, and real-world tasks that you can work on to go from the basics of Go, into building production apps.

Is this course FREE?

Yes, this a 100% free course that you can contribute to on GitHub here!

3. Create entrypoint

4. Run fmt

5. Build

go build

6. Run

./demo-go-webservice (runs binary built from go build)

In the future, we will more frequently use go run main.go which will build on the fly and then run.

7. Add dep

Since Go's out-of-the-box package manager won't let us share our requirements with implementers, we use dep (install it from here if you don't have it yet) to use the Go vendor directory standard and also give us a lockfile and package list to put into the Git repo. Some developers like to add the vendor directory to Git, however, for this project, we will opt to ignore it. Implementers will need to run dep ensure in order to get the dependencies or it will use their local versions.

Setup: dep init

Load: dep ensure -v # The v flag will show us more detailed progress as it might take a bit with more dependencies

8. (Optional) Commit our first step

Add our changes: git add .

Commit our changes: git commit -m"Init go project"

Note: if you want to push to a remote, now would be the time to add it and start pushing!

Project Source Code

For reference (or lazy typists!) you may find the full source on GitHub here.

Intro Wrap Up

We now have a working minimal Go project that will form the basis of our web service and all related files. Now is a good time to open this up in an IDE as from here on out, there won't be such detailed explanations of steps like 'build', 'run', or 'create a go file'. It will be assumed that if you don't already know, that you can use this as a reference, or find a resource in the EXLskills A$AP Go Open Course!