Articles with the tag "web-development"

JSON APIs Are Just Web Applications

A common misconception is that a JSON API is vastly different from a web application that renders server-side HTML. In this article we explore how to convert an HTML-based web app into a JSON API in order to demonstrate how similar the two really are in a well designed app.

Why Cant I Pass This Function as an Http Handler?!

An incredibly common question I get when helping people learn web development is, "Why can’t I pass this handler function into a function that expects an http.Handler?" It is a logical question. The compiler can automatically convert those functions into the http.HandlerFunc type, so why can't it take the next step and infer that it also implements the Handler interface? Learn why (and more) in this article!

Using the Service Object Pattern in Go

Developing a web application without separating the logic used to parse an incoming request from the actual application logic can be painful. It is hard to test your card, dependencies aren't clear, and the code can become a mess. Learn how to apply the service object pattern to your Go code in order to properly isolate these concerns, making it easier to test, maintain, and read your code.

An Introduction to Templates in Go

This four part series explores Go's template package, which can be used to render HTML or text. Topics covered include contextual encoding, actions, using functions in templates, and how to build a proper view layer for a web application.

Pitfalls of context values and how to avoid or mitigate them in Go

Storing data in a context.Context, or as I refer to it - using context values, is one of the most contentious design patterns in Go. Storing values in a context appears to be fine with everyone, but what specifically should be stored as a context value receives a lot of heated discussion. I’ll be honest - when I started using them I used them in the naive and somewhat inappropriate way that everyone complains about.

Inserting records into a PostgreSQL database with Go's database/sql package

Learn to insert new records into a Postgres database using Go's database/sql package, along with how to get the resulting ID of newly created records.

Learn Web Development with Go!

Sign up for my mailing list and I'll send you a FREE sample from my course - Web Development with Go. The sample includes three chapters from the book, and over 2.5 hours of screencasts.

You will also receive notifications when I release new articles, along with other freebies that I only share with my mailing list.

Avatar of Jon Calhoun
Articles and Tutorials by
Jon Calhoun

Jon Calhoun is a full stack web developer who also teaches about Go, web development, algorithms, and anything programming related. He also consults for other companies who have development needs. (If you need some development work done, get in touch!)

Jon is a co-founder of EasyPost, a shipping API that many fortune 500 companies use to power their shipping infrastructure, and prior to founding EasyPost he worked at google as a software engineer.

Recent Articles All Articles Mini-Series Tags About Me Go Courses

©2018 Jonathan Calhoun. All rights reserved.