The /examples
directory stores examples for provided APIs that are defined in the /api
directory, public packages from the /pkg
directory, ways to use and run applications from the /apps
directory or to demonstrate the integration with other applications, platforms or systems.
A common practice is that each example is placed in an individual directory whose name matches its use case. Please see the example below for a common and practical usage pattern.
Given the API defined in the example of the /api
directory the structure could be created as follows:
examples
├─ auto-backup
└─ synchronization
Next to the experience with own projects and golang-standards/project-layout, many other large, production-grade and well-known projects of the Go ecosystem have been used as references: