# Go middleware handlers

Published articles for Go middleware handlers.

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. 11: Enhancing Go Code with Effective Application Layer Tests

DevFeed: [Ep. 11: Enhancing Go Code with Effective Application Layer Tests](<https://devfeed.tech/articles/ep-11-enhancing-go-code-with-effective-application-layer-tests-22254.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2024/07/proper-prompt-formatting-for-enhanced-ai-model-performance-ep-11.html>)

Published: 2024-07-30T00: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>), [Testing](<https://devfeed.tech/topics/testing.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>)

Tags: [code-coverage](<https://devfeed.tech/tags/code-coverage.md>), [comprehensive-go-testing](<https://devfeed.tech/tags/comprehensive-go-testing.md>), [context](<https://devfeed.tech/tags/context.md>), [context-management-go-tests](<https://devfeed.tech/tags/context-management-go-tests.md>), [continuous-integration](<https://devfeed.tech/tags/continuous-integration.md>), [debugging-go-applications](<https://devfeed.tech/tags/debugging-go-applications.md>), [effective-test-organization-go](<https://devfeed.tech/tags/effective-test-organization-go.md>), [efficient-go-testing-techniques](<https://devfeed.tech/tags/efficient-go-testing-techniques.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [go](<https://devfeed.tech/tags/go.md>), [go-application-layer-tests](<https://devfeed.tech/tags/go-application-layer-tests.md>), [go-authentication-tokens](<https://devfeed.tech/tags/go-authentication-tokens.md>), [go-continuous-integration-testing](<https://devfeed.tech/tags/go-continuous-integration-testing.md>), [go-dependencies-management](<https://devfeed.tech/tags/go-dependencies-management.md>), [go-error-handling-consistency](<https://devfeed.tech/tags/go-error-handling-consistency.md>), [go-middleware-handlers](<https://devfeed.tech/tags/go-middleware-handlers.md>), [go-project-test-implementation](<https://devfeed.tech/tags/go-project-test-implementation.md>), [go-subtests-domain-level](<https://devfeed.tech/tags/go-subtests-domain-level.md>), [go-testing-strategies](<https://devfeed.tech/tags/go-testing-strategies.md>), [maintaining-go-software-quality](<https://devfeed.tech/tags/maintaining-go-software-quality.md>), [mock-apis-go-testing](<https://devfeed.tech/tags/mock-apis-go-testing.md>), [reliable-go-codebase](<https://devfeed.tech/tags/reliable-go-codebase.md>), [resilient-go-application](<https://devfeed.tech/tags/resilient-go-application.md>), [scalable-go-software-systems](<https://devfeed.tech/tags/scalable-go-software-systems.md>), [table-driven-tests](<https://devfeed.tech/tags/table-driven-tests.md>), [table-driven-tests-go](<https://devfeed.tech/tags/table-driven-tests-go.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

Episode 11 of the Ultimate Software Design series explains how to implement application-layer tests in Go. It covers domain-level test organization, subtests, table-driven tests, mock APIs, dependency management, authentication tokens, context, and consistent error handling, with the goal of broad coverage using minimal database instances.

### Source excerpt

Introduction: Welcome to Episode 11 of our Ultimate Software Design series! In this episode, Bill delves into the intricacies of implementing robust application layer tests within Go projects, providing developers with essential strategies for creating scalable and maintainable software systems. Implement application layer tests that ensure comprehensive coverage with minimal database instances. Organize tests at the domain level using subtests for easier issue isolation and resilient code. Manage dependencies, authentication tokens, and context for smooth information flow and consistent error handling.

## 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.