As codebase grows, readability degrades and bugs are introduced. We'll learn how to use standard Go tools to improve our codebase.
- [Instructor] Hi, and welcome back.…In the previous video, we learned about…a number of frameworks we could integrate…into our web application to write code faster…and give our code more structure.…In this video, we'll use standard tools…to improve our code base.…We'll start by learning to use the Go Format tool…to standardize the style of our code.…Then, we'll use Go Lint to find…readability issues with our code.…We'll end the video by using Go's built-in testing library…to write a few unit tests.…We'll start with formatting our code…to a standardized style.…
In many languages, programmers must choose…between tabs and spaces, how to do camelCase,…and where to put curly braces.…In the world of Go, these choices have…already been made by the community.…We can use a tool called Go Format to automatically…format our code base.…If we open a terminal within the directory of…our library application, we can run Go Format…to update our code in place.…You can see the list of files here…that the tool has reformatted.…Let's look at the differences side by side in a diff tool.…
Go is on the rise. This open-source programming language (created by Google!) comes with a strong and accessible standard library, and provides a growing ecosystem of tools, libraries, and frameworks that can help you build web applications fast. Go for Web Development gets you started with the language, opening with the classic "Hello world" exercise and culminating in a web application with a strongly designed database back end, useful middleware, UI with an intelligent search function, multi-user authentication, and more.
First, learn how to build a web server with Go's extensive standard library. Explore the concepts behind a single-page web application and learn how to create a dynamic user interface, manipulate a database, and use powerful encryption algorithms to implement an authentication system. Next, you'll incorporate more functionality by calling out to external libraries from the database. Finally, it all comes together into an optimized package you can deploy into the wild with Heroku.
- Creating a route in Go
- Using templates
- Building database connections
- Collecting data
- Using web middleware
- Using the Ace template engine
- Integrating HTTP routers like gorilla/mux
- Authenticating users
- Optimizing a Go codebase