Chapter 9

Encoding and Decoding Data Using JSON

IN THIS CHAPTER

Bullet Understanding JSON

Bullet Decoding JSON to the various data types in Go

Bullet Encoding JSON strings

JavaScript Object Notation (JSON) is a standard, text-based format for representing data using the JavaScript object syntax. It’s a lightweight and easy-to-parse data representation language, commonly used for communicating between web servers and clients.

In this chapter, I explain the basics of JSON and how you can manipulate JSON content in your Go applications.

Getting Acquainted with JSON

JSON is growing more and more popular these days. It’s commonly used in data representation, as well as data exchange. JSON is less verbose than XML, but that’s exactly what makes it so useful. JSON strings are shorter than their XML equivalents, and parsing JSON strings is a walk in the park.

Technical Stuff If you aren’t familiar with XML, check out the introduction to XML at www.w3schools.com/xml/xml:whatis.asp.

In this section, I give you a brief walk-through of JSON. If you’re already super-familiar with JSON, you can skip directly to the “Decoding JSON ...

Get Go Programming Language For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.