# unmarshalling

Published articles for unmarshalling.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## JSON - The Fine Print: Part 3 - Zero vs Missing Values

DevFeed: [JSON - The Fine Print: Part 3 - Zero vs Missing Values](<https://devfeed.tech/articles/json-the-fine-print-part-3-zero-vs-missing-values-22281.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2025/05/json-the-fine-print-part-3.html>)

Published: 2025-05-19T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [JSON](<https://devfeed.tech/topics/json.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [api-layers](<https://devfeed.tech/tags/api-layers.md>), [code](<https://devfeed.tech/tags/code.md>), [common-serialization-errors](<https://devfeed.tech/tags/common-serialization-errors.md>), [data-serialization](<https://devfeed.tech/tags/data-serialization.md>), [data-structure-separation](<https://devfeed.tech/tags/data-structure-separation.md>), [data-transmission](<https://devfeed.tech/tags/data-transmission.md>), [data-validation](<https://devfeed.tech/tags/data-validation.md>), [encoding-json](<https://devfeed.tech/tags/encoding-json.md>), [go](<https://devfeed.tech/tags/go.md>), [go-json-types](<https://devfeed.tech/tags/go-json-types.md>), [go-language-serialization](<https://devfeed.tech/tags/go-language-serialization.md>), [go-language-validation](<https://devfeed.tech/tags/go-language-validation.md>), [go-type-mapping](<https://devfeed.tech/tags/go-type-mapping.md>), [json](<https://devfeed.tech/tags/json.md>), [json-best-practices](<https://devfeed.tech/tags/json-best-practices.md>), [json-go-mapping](<https://devfeed.tech/tags/json-go-mapping.md>), [json-marshaling](<https://devfeed.tech/tags/json-marshaling.md>), [json-unmarshaling](<https://devfeed.tech/tags/json-unmarshaling.md>), [json-validation](<https://devfeed.tech/tags/json-validation.md>), [passing-serialized-data](<https://devfeed.tech/tags/passing-serialized-data.md>), [rest-apis](<https://devfeed.tech/tags/rest-apis.md>), [schema-less-data-format](<https://devfeed.tech/tags/schema-less-data-format.md>), [serialization](<https://devfeed.tech/tags/serialization.md>), [serialization-mistakes](<https://devfeed.tech/tags/serialization-mistakes.md>), [serialization-protocols](<https://devfeed.tech/tags/serialization-protocols.md>), [unmarshalling](<https://devfeed.tech/tags/unmarshalling.md>)

### AI overview

This tutorial examines how to distinguish zero values from missing or NULL fields when consuming JSON in Go. It explains basic unmarshalling into structs, notes that absent fields do not cause errors, and introduces DisallowUnknownFields for validating exact JSON input.

### Source excerpt

Introduction In part 1 we took a higher level view on serialization in general and JSON in specific. In part 2 we looked at emitting JSON. In part 3, we'll look at an issue you might encounter when consuming JSON, Zero vs NULL field values. To clarify the definition of NULL, this means the absence of value. So here is the question: Given a field in a Go struct set to its zero value, how do you know that zero value was set by the user or it's zero because it was never provided?

## Managing JSON Field Tags and Value Handling in Go - Ep.3

DevFeed: [Managing JSON Field Tags and Value Handling in Go - Ep.3](<https://devfeed.tech/articles/managing-json-field-tags-and-value-handling-in-go-ep-3-22265.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/10/json-the-fine-print-ep-3-managing-json-field-tags-and-value-handling-in-go.html>)

Published: 2024-10-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [JSON](<https://devfeed.tech/topics/json.md>), [Parsing](<https://devfeed.tech/topics/parsing.md>)

Tags: [default-values-in-go-structs](<https://devfeed.tech/tags/default-values-in-go-structs.md>), [go](<https://devfeed.tech/tags/go.md>), [go-default-values](<https://devfeed.tech/tags/go-default-values.md>), [go-field-tagging-techniques](<https://devfeed.tech/tags/go-field-tagging-techniques.md>), [go-struct-mapping](<https://devfeed.tech/tags/go-struct-mapping.md>), [handling-flexible-json](<https://devfeed.tech/tags/handling-flexible-json.md>), [handling-missing-json-values](<https://devfeed.tech/tags/handling-missing-json-values.md>), [json](<https://devfeed.tech/tags/json.md>), [json-code-reliability](<https://devfeed.tech/tags/json-code-reliability.md>), [json-data-consistency](<https://devfeed.tech/tags/json-data-consistency.md>), [json-data-structures-go](<https://devfeed.tech/tags/json-data-structures-go.md>), [json-field-consistency-go](<https://devfeed.tech/tags/json-field-consistency-go.md>), [json-field-integration-in-go](<https://devfeed.tech/tags/json-field-integration-in-go.md>), [json-field-mapping](<https://devfeed.tech/tags/json-field-mapping.md>), [json-field-tagging-in-go](<https://devfeed.tech/tags/json-field-tagging-in-go.md>), [json-for-engineers](<https://devfeed.tech/tags/json-for-engineers.md>), [json-in-go](<https://devfeed.tech/tags/json-in-go.md>), [json-in-strongly-typed-languages](<https://devfeed.tech/tags/json-in-strongly-typed-languages.md>), [json-keys-to-go-fields](<https://devfeed.tech/tags/json-keys-to-go-fields.md>), [json-parsing-errors](<https://devfeed.tech/tags/json-parsing-errors.md>), [json-parsing-strategies-go](<https://devfeed.tech/tags/json-parsing-strategies-go.md>), [json-pointers-in-go](<https://devfeed.tech/tags/json-pointers-in-go.md>), [json-schema-handling](<https://devfeed.tech/tags/json-schema-handling.md>), [json-structs-in-go](<https://devfeed.tech/tags/json-structs-in-go.md>), [json-to-go-data-integration](<https://devfeed.tech/tags/json-to-go-data-integration.md>), [json-to-go-parsing](<https://devfeed.tech/tags/json-to-go-parsing.md>), [json-unmarshalling-in-go](<https://devfeed.tech/tags/json-unmarshalling-in-go.md>), [json-value-handling](<https://devfeed.tech/tags/json-value-handling.md>), [managing-missing-values-in-json](<https://devfeed.tech/tags/managing-missing-values-in-json.md>), [managing-zero-values-in-json](<https://devfeed.tech/tags/managing-zero-values-in-json.md>), [map-string-interface-json](<https://devfeed.tech/tags/map-string-interface-json.md>), [mapping-json-to-go-structs](<https://devfeed.tech/tags/mapping-json-to-go-structs.md>), [unmarshalling](<https://devfeed.tech/tags/unmarshalling.md>)

### AI overview

This episode explains how to map JSON fields to Go struct fields with tags, distinguish missing values from zero values during unmarshalling, and use pointers, maps, or default struct values to handle flexible JSON data.

### Source excerpt

Introduction: Welcome to Episode 3 of JSON for Engineers! In this episode, Miki Tebeka explores the intricacies of JSON field mapping and value handling, especially when working in strongly typed languages like Go. This session covers the practical challenges of matching JSON fields to Go struct fields, distinguishing between missing and zero values, and using default values to ensure robust JSON parsing. These strategies are crucial for engineers managing flexible JSON data structures in a language with strict type requirements.

## Interfaces 101 : Parsing Command Flags Ep. 9

DevFeed: [Interfaces 101 : Parsing Command Flags Ep. 9](<https://devfeed.tech/articles/interfaces-101-parsing-command-flags-ep-9-22219.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2023/03/interfaces-101-parsing-command-flags-ep-9.html>)

Published: 2023-03-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Code](<https://devfeed.tech/topics/code.md>), [client](<https://devfeed.tech/topics/client.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [cli](<https://devfeed.tech/tags/cli.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [data-transformation](<https://devfeed.tech/tags/data-transformation.md>), [flag](<https://devfeed.tech/tags/flag.md>), [go](<https://devfeed.tech/tags/go.md>), [golang](<https://devfeed.tech/tags/golang.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [http](<https://devfeed.tech/tags/http.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [learn](<https://devfeed.tech/tags/learn.md>), [unmarshalling](<https://devfeed.tech/tags/unmarshalling.md>), [validation](<https://devfeed.tech/tags/validation.md>)

### AI overview

A video tutorial explains how to decode a command-line flag representing an address into a user-defined Go struct. It covers the interface methods involved and validates the supplied flag value.

### Source excerpt

Introduction In episode 8, Miki developed a Go HTTP client that had a method to check the health of a theoretical API. The method would construct the request URL and return an error based on the response code received from the server. Miki then created a type that would mock Go's http.RoundTripper interface and replace his client's transport with said type to test it. To improve the efficacy, Miki's stub will simulate an erroneous response to see if his client's Health method is working as intended.