The Startup
Published in

The Startup

Golang Maps vs. Structs, Which Method Should You Use to Parse JSON

Photo by Markus Spiske on Unsplash

Before learning Go, I used to write most of my applications in Python. When I was transitioning from Python to Go, I was familiar with parsing JSON, YAML, etc., into Python dictionaries. What I never understood is why I would see so many examples parsing JSON into Go structs. Why not use maps, which are equivalent to a Python dictionary. What were the benefits of using structs…

--

--

--

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +756K followers.

Recommended from Medium

Head First Java Chapter 05 — Extra Strength Methods

Is Java Set ordered or not?

3 Obstacles Hampering Organizational Agility

Introduction to Python Programming Part 5— Functions, Object Introspection and Modules

How to setup MongoDB replica set

How to setup MongoDB replica set

Oracle: How to Mask Sensitive Data with the Views — Quickly and Free

Digital Input with a Push Button with Arduino in Tinkercad

Analysis of the NaimitsuAI project based on the C.U.T.E. system.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Benjamin Cane

Benjamin Cane

Distinguished Engineer @AmericanExpress building payments systems. Author: https://amzn.to/3kuCFpz, Thoughts, & Opinions are my own.

More from Medium

Tutorial: Building a Golang application Docker image

How to use Golang generics with structs

Getting started with GO Programming Language — Part Two

SOLID Principles of Object-Oriented Design in GoLang (Part-3)