Skip to main content

Structs and Interfaces

  • Chapter
  • First Online:
Go Recipes

Abstract

When you write programs, the type system of your choice of language is very important. Types allow you to organize your application data in a structured way that can be persisted into various data stores. When you write applications, especially business applications, you organize your application data using various types and persist the values of those types into persistence storage. When you write applications with Go, it is important to understand its type system and its design philosophy. Go provides various built-in types such as int, uint, float64, string, and bool. Data structures for storing collections of values such as arrays, slices, and maps are known as composite types because they are made up of other types—built-in types and user-defined types. In addition to the built-in types provided by Go, you can create your own types by combining with other types. This chapter contains recipes for user-defined types in Go.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Shiju Varghese

About this chapter

Cite this chapter

Varghese, S. (2016). Structs and Interfaces. In: Go Recipes. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-1188-5_3

Download citation

Publish with us

Policies and ethics