# 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.