agent/pkg/setup/service_example_test.go
Virgil f0c903d8c3 fix(ax): replace typed service lookups with Core.Service
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-31 05:43:14 +00:00

28 lines
635 B
Go

// SPDX-License-Identifier: EUPL-1.2
package setup
import (
core "dappco.re/go/core"
)
func ExampleRegister_service() {
c := core.New(core.WithService(Register))
serviceResult := c.Service("setup")
service, ok := serviceResult.Value.(*Service)
core.Println(ok)
core.Println(service != nil)
// Output:
// true
// true
}
func ExampleService_DetectGitRemote() {
c := core.New()
service := &Service{ServiceRuntime: core.NewServiceRuntime(c, RuntimeOptions{})}
// Non-git dir returns empty
remote := service.DetectGitRemote((&core.Fs{}).NewUnrestricted().TempDir("example"))
core.Println(remote == "")
// Output: true
}