![]() ![]() This tutorial won't go too in depth about either setup method, but here are some excellent resources if you'd like to know more:įor this tutorial, we're going to use Go modules. Setting up your GOPATH workspace can be a bit cumbersome, so Go introduced a new dependency management system, Go Modules, in version 1.11. Once Go is installed, there are two options to finish setup: Go Modules or GOPATH. Let's get started! First, you need to install Go. Therefore, learning any or all of them will still be beneficial, as the skills will be applicable throughout your Go career. Since the net /http standard package already provides so much functionality, these frameworks tend to be built on top of it or at least use parts of the net /http package. Beego, Gin Gionic, Echo, and Revel are just some of the more traditional web/api frameworks available. With that said, a couple of handy libraries such as gorilla /mux for routing and dgrijalva /jwt -go for JSON Web Tokens will be used to speed up development.īefore jumping into the code, I do want to point out that while idiomatic Go tends to shy away from large frameworks, it does not mean that no frameworks are written in Go. This article will adhere to these idioms as much as possible to ensure that the code samples are applicable across the Go ecosystem. Idiomatic Go prefers small libraries over large frameworks and the use of the standard library whenever possible. The app you are building today is called “We R VR.” The app allows virtual reality enthusiasts to provide feedback to developers on the games and experiences they are building. And augmented with the Gorilla Toolkit, you'll have an API up and running in no time. ![]() The net /http standard library provides key methods for interacting via the HTTP protocol. Go is an excellent choice for building fast and scalable RESTful APIs. If you are already somewhat familiar with Go, on the other hand, then let’s build an API! If you are new to Go, check out the masterfully crafted Tour of Go, which covers everything from the basics to advanced topics such as concurrency, and then, you’ll be ready to proceed with this tutorial. It is out of the scope of this tutorial to cover the fundamentals of the Go programming language. In this tutorial, you will be building a RESTful API in Go, so knowledge of the Go language is a prerequisite. ![]()
0 Comments
Leave a Reply. |