Badger store: avoid code duplication by using generic methods (#369)

* Badger store: avoid code duplication by using generic methods

* No need to return PT, can return just *T
This commit is contained in:
Nikolay Edigaryev
2025-11-17 18:34:59 +04:00
committed by GitHub
parent dbb180befb
commit 9cdfd75f79
12 changed files with 146 additions and 287 deletions
+2 -2
View File
@@ -196,8 +196,8 @@ func New(opts ...Option) (*Controller, error) {
return controller, nil
}
func (controller *Controller) ServiceAccounts() ([]*v1.ServiceAccount, error) {
var serviceAccounts []*v1.ServiceAccount
func (controller *Controller) ServiceAccounts() ([]v1.ServiceAccount, error) {
var serviceAccounts []v1.ServiceAccount
var err error
if err := controller.store.View(func(txn storepkg.Transaction) error {