Search⌘ K
AI Features

Developing a Basic Phone Book Application

Explore how to create a basic phone book application in Go by implementing user-defined data types, slices, and functions for searching and listing entries. Understand command-line utility design and gain foundational skills for managing data in Go programs.

Introduction

In this lesson, to utilize the skills we’ve picked up so far, we will develop a basic phone book application in Go. Despite its limitations, the presented application is a command-line utility that searches a slice of structures that is statically defined (hardcoded) in the Go code. The utility offers support for two commands named search and list that search for a given surname and return its full record if the surname is found and lists all available records, respectively.

Shortcomings

The implementation has many shortcomings, including the following:

    ...