# Maintainable Go code

Published articles for Maintainable Go code.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Ep. 9: Go Package Design: Authorization and API Structures

DevFeed: [Ep. 9: Go Package Design: Authorization and API Structures](<https://devfeed.tech/articles/ep-9-go-package-design-authorization-and-api-structures-22251.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/07/go-package-design-authorization-and-api-structures-ep-9.html>)

Published: 2024-07-17T00: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>), [Authorization](<https://devfeed.tech/topics/authorization.md>), [rego](<https://devfeed.tech/topics/rego.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [access-control](<https://devfeed.tech/tags/access-control.md>), [api-structures-in-go](<https://devfeed.tech/tags/api-structures-in-go.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [clean-code-go](<https://devfeed.tech/tags/clean-code-go.md>), [context-in-go-middleware](<https://devfeed.tech/tags/context-in-go-middleware.md>), [efficient-go-code](<https://devfeed.tech/tags/efficient-go-code.md>), [error-handling-patterns-go](<https://devfeed.tech/tags/error-handling-patterns-go.md>), [exported-and-unexported-apis-go](<https://devfeed.tech/tags/exported-and-unexported-apis-go.md>), [go](<https://devfeed.tech/tags/go.md>), [go-api-best-practices](<https://devfeed.tech/tags/go-api-best-practices.md>), [go-api-readability](<https://devfeed.tech/tags/go-api-readability.md>), [go-authorization](<https://devfeed.tech/tags/go-authorization.md>), [go-authorization-logic](<https://devfeed.tech/tags/go-authorization-logic.md>), [go-development-practices](<https://devfeed.tech/tags/go-development-practices.md>), [go-error-management](<https://devfeed.tech/tags/go-error-management.md>), [go-middleware-handlers](<https://devfeed.tech/tags/go-middleware-handlers.md>), [go-package-design](<https://devfeed.tech/tags/go-package-design.md>), [go-package-organization](<https://devfeed.tech/tags/go-package-organization.md>), [go-package-tutorials](<https://devfeed.tech/tags/go-package-tutorials.md>), [go-software-architecture](<https://devfeed.tech/tags/go-software-architecture.md>), [go-software-tips](<https://devfeed.tech/tags/go-software-tips.md>), [intuitive-go-codebase](<https://devfeed.tech/tags/intuitive-go-codebase.md>), [maintainable-go-code](<https://devfeed.tech/tags/maintainable-go-code.md>), [rego](<https://devfeed.tech/tags/rego.md>), [rego-scripts-for-go](<https://devfeed.tech/tags/rego-scripts-for-go.md>), [role-based-authorization-in-go](<https://devfeed.tech/tags/role-based-authorization-in-go.md>), [scalable-go-software-design](<https://devfeed.tech/tags/scalable-go-software-design.md>), [secure-access-control-go](<https://devfeed.tech/tags/secure-access-control-go.md>), [software-design](<https://devfeed.tech/tags/software-design.md>), [user-claims-context-go](<https://devfeed.tech/tags/user-claims-context-go.md>)

### AI overview

This episode explains how to design Go packages that support role-based authorization with Rego, clearly separate exported and unexported APIs, manage errors consistently, and pass information through context between middleware and handlers.

### Source excerpt

Introduction: Welcome to Episode 9 of our Ultimate Software Design series! In this episode, Bill delves into the intricacies of implementing robust authorization and API structure within Go packages, offering invaluable insights for developers aiming to build scalable and maintainable software systems. Implement role-based authorization logic for secure and precise access control using Rego scripts. Learn best practices for structuring exported and unexported APIs to maintain a clean, intuitive, and maintainable codebase.

## Ep. 7: Building Resilient Go Applications: Key Error Handling Techniques

DevFeed: [Ep. 7: Building Resilient Go Applications: Key Error Handling Techniques](<https://devfeed.tech/articles/ep-7-building-resilient-go-applications-key-error-handling-techniques-22241.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/06/building-resilient-go-applications-key-error-handling-techniques-ep-7.html>)

Published: 2024-06-20T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Logging](<https://devfeed.tech/topics/logging.md>), [integrity](<https://devfeed.tech/topics/integrity.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [comprehensive-error-handling-go](<https://devfeed.tech/tags/comprehensive-error-handling-go.md>), [contextual-error-handling-go](<https://devfeed.tech/tags/contextual-error-handling-go.md>), [data-validation-signals-in-go](<https://devfeed.tech/tags/data-validation-signals-in-go.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [debugging-errors-in-go](<https://devfeed.tech/tags/debugging-errors-in-go.md>), [detailed-error-management-go](<https://devfeed.tech/tags/detailed-error-management-go.md>), [effective-go-error-logging](<https://devfeed.tech/tags/effective-go-error-logging.md>), [efficient-error-logging-go](<https://devfeed.tech/tags/efficient-error-logging-go.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [error-handling-best-practices-go](<https://devfeed.tech/tags/error-handling-best-practices-go.md>), [error-handling-framework-go](<https://devfeed.tech/tags/error-handling-framework-go.md>), [error-handling-strategies-go](<https://devfeed.tech/tags/error-handling-strategies-go.md>), [error-management-in-go](<https://devfeed.tech/tags/error-management-in-go.md>), [go](<https://devfeed.tech/tags/go.md>), [go-application-resilience](<https://devfeed.tech/tags/go-application-resilience.md>), [go-application-stability](<https://devfeed.tech/tags/go-application-stability.md>), [go-error-handling](<https://devfeed.tech/tags/go-error-handling.md>), [go-error-handling-methods](<https://devfeed.tech/tags/go-error-handling-methods.md>), [go-error-handling-techniques](<https://devfeed.tech/tags/go-error-handling-techniques.md>), [go-error-propagation-prevention](<https://devfeed.tech/tags/go-error-propagation-prevention.md>), [go-error-recovery-strategies](<https://devfeed.tech/tags/go-error-recovery-strategies.md>), [go-error-signaling-semantics](<https://devfeed.tech/tags/go-error-signaling-semantics.md>), [go-errors-as-signals](<https://devfeed.tech/tags/go-errors-as-signals.md>), [go-shutdown-signals](<https://devfeed.tech/tags/go-shutdown-signals.md>), [horizontal-signaling-go-errors](<https://devfeed.tech/tags/horizontal-signaling-go-errors.md>), [integrity](<https://devfeed.tech/tags/integrity.md>), [logging](<https://devfeed.tech/tags/logging.md>), [logging-errors-in-go](<https://devfeed.tech/tags/logging-errors-in-go.md>), [maintainable-go-code](<https://devfeed.tech/tags/maintainable-go-code.md>), [preventing-error-propagation-in-go](<https://devfeed.tech/tags/preventing-error-propagation-in-go.md>), [recovering-from-errors-in-go](<https://devfeed.tech/tags/recovering-from-errors-in-go.md>), [reliable-go-applications](<https://devfeed.tech/tags/reliable-go-applications.md>), [three-step-error-handling-go](<https://devfeed.tech/tags/three-step-error-handling-go.md>), [trusted-errors-in-go](<https://devfeed.tech/tags/trusted-errors-in-go.md>), [writing-robust-go-code](<https://devfeed.tech/tags/writing-robust-go-code.md>)

### AI overview

A video tutorial for Go developers presents a three-step error-handling approach: log errors once, decide whether recovery or termination is appropriate, and prevent handled errors from propagating. It also explains errors as signals and discusses trusted errors, shutdown signals, and data validation signals.

### Source excerpt

Introduction: Going into more detail on error handling, Bill provides a comprehensive overview of effective strategies and best practices for Go developers. By exploring the nuances of error management, he equips developers with the tools needed to write more reliable and maintainable code. Learn the three-step approach to logging errors, determining recovery, and preventing propagation. Understand how treating errors as signals, similar to channels' horizontal signaling, enhances error management. Discover the importance of implementing trusted errors, shutdown signals, and data validation signals to maintain code integrity and reliability.