feat: refactor.

This commit is contained in:
tx7do
2024-05-06 10:38:46 +08:00
parent 72daf43151
commit f4658eb5d9
2 changed files with 62 additions and 2 deletions

19
bootstrap_test.go Normal file
View File

@@ -0,0 +1,19 @@
package bootstrap
import (
"github.com/go-kratos/kratos/v2"
"github.com/go-kratos/kratos/v2/log"
"github.com/go-kratos/kratos/v2/registry"
v1 "github.com/tx7do/kratos-bootstrap/api/gen/go/conf/v1"
"testing"
)
func initApp(logger log.Logger, registrar registry.Registrar, bootstrap *v1.Bootstrap) (*kratos.App, func(), error) {
app := NewApp(logger, registrar)
return app, func() {
}, nil
}
func TestBootstrap(t *testing.T) {
Bootstrap(initApp)
}