agent/pkg/setup/service_example_test.go
Virgil f9eca5e395 fix(ax): align runtime names with AX principles
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:53:36 +00:00

27 lines
608 B
Go

// SPDX-License-Identifier: EUPL-1.2
package setup
import (
core "dappco.re/go/core"
)
func ExampleRegister_serviceFor() {
c := core.New(core.WithService(Register))
service, ok := core.ServiceFor[*Service](c, "setup")
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
}