Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Software Architecture with Golang

You're reading from   Hands-On Software Architecture with Golang Design and architect highly scalable and robust applications using Go

Arrow left icon
Product type Paperback
Published in Dec 2018
Publisher Packt
ISBN-13 9781788622592
Length 500 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Jyotiswarup Raiturkar Jyotiswarup Raiturkar
Author Profile Icon Jyotiswarup Raiturkar
Jyotiswarup Raiturkar
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Building Big with Go FREE CHAPTER 2. Packaging Code 3. Design Patterns 4. Scaling Applications 5. Going Distributed 6. Messaging 7. Building APIs 8. Modeling Data 9. Anti-Fragile Systems 10. Case Study – Travel Website 11. Planning for Deployment 12. Migrating Applications 13. Other Books You May Enjoy

Modules

Eventually, any interesting software project will come to depend on another project, library, or framework. Packages provide a namespace or a firewall for your code. By firewall I mean, insulate the code in the package from changes in other parts or packages. Entities inside a package (types, functions, variables, and so on) can be exported (public—visible outside the package) or unexported (private—not visible outside the package). The way to control visibility is exactly like the mechanism described for classes: if the identifier name starts with a capital letter, and it is exported from the package, otherwise, it's unexported.

This is an example of a convention over configuration paradigm and is one of the key enablers of encapsulation in Go. The rule of thumb is this:

All code of the package should be private, unless explicitly needed by other client...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime