From c7e6f20e289aee188de5482d374caa20f3a0d55e Mon Sep 17 00:00:00 2001 From: Yanhu007 Date: Tue, 14 Apr 2026 13:07:02 +0800 Subject: [PATCH] fix: export BasePool interface for correct godoc rendering The private basePool interface embedded in Pool and ResultPool causes go doc to omit all base methods from the generated documentation. Export it as BasePool so the full API surface is visible on pkg.go.dev. Fixes #141 --- pool.go | 6 +++--- result.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pool.go b/pool.go index 4fcae8a..ad9542e 100644 --- a/pool.go +++ b/pool.go @@ -34,8 +34,8 @@ var ( }() ) -// basePool is the base interface for all pool types. -type basePool interface { +// BasePool defines methods common to all pool types. +type BasePool interface { // Returns the number of worker goroutines that are currently active (executing a task) in the pool. RunningWorkers() int64 @@ -94,7 +94,7 @@ type basePool interface { // Represents a pool of goroutines that can execute tasks concurrently. type Pool interface { - basePool + BasePool // Submits a task to the pool without waiting for it to complete. // The pool will not accept new tasks after it has been stopped. diff --git a/result.go b/result.go index 6db8750..3f0d4d4 100644 --- a/result.go +++ b/result.go @@ -8,7 +8,7 @@ import ( // ResultPool is a pool that can be used to submit tasks that return a result. type ResultPool[R any] interface { - basePool + BasePool // Submits a task to the pool and returns a future that can be used to wait for the task to complete and get the result. // The pool will not accept new tasks after it has been stopped.