diff --git a/.golangci.yml b/go/.golangci.yml similarity index 100% rename from .golangci.yml rename to go/.golangci.yml diff --git a/pkg/core/app.go b/go/core/app.go similarity index 99% rename from pkg/core/app.go rename to go/core/app.go index 582f452..3a5aa02 100644 --- a/pkg/core/app.go +++ b/go/core/app.go @@ -32,7 +32,6 @@ type App struct { Runtime any } - // Find locates a program on PATH and returns a Result containing the App. // // r := core.Find("node", "Node.js") diff --git a/pkg/core/array.go b/go/core/array.go similarity index 100% rename from pkg/core/array.go rename to go/core/array.go diff --git a/pkg/core/cli.go b/go/core/cli.go similarity index 100% rename from pkg/core/cli.go rename to go/core/cli.go diff --git a/pkg/core/command.go b/go/core/command.go similarity index 100% rename from pkg/core/command.go rename to go/core/command.go diff --git a/pkg/core/config.go b/go/core/config.go similarity index 95% rename from pkg/core/config.go rename to go/core/config.go index 41415b7..395a0f6 100644 --- a/pkg/core/config.go +++ b/go/core/config.go @@ -14,8 +14,8 @@ type ConfigVar[T any] struct { set bool } -func (v *ConfigVar[T]) Get() T { return v.val } -func (v *ConfigVar[T]) Set(val T) { v.val = val; v.set = true } +func (v *ConfigVar[T]) Get() T { return v.val } +func (v *ConfigVar[T]) Set(val T) { v.val = val; v.set = true } func (v *ConfigVar[T]) IsSet() bool { return v.set } func (v *ConfigVar[T]) Unset() { v.set = false diff --git a/pkg/core/contract.go b/go/core/contract.go similarity index 100% rename from pkg/core/contract.go rename to go/core/contract.go diff --git a/pkg/core/core.go b/go/core/core.go similarity index 100% rename from pkg/core/core.go rename to go/core/core.go diff --git a/pkg/core/data.go b/go/core/data.go similarity index 100% rename from pkg/core/data.go rename to go/core/data.go diff --git a/pkg/core/drive.go b/go/core/drive.go similarity index 100% rename from pkg/core/drive.go rename to go/core/drive.go diff --git a/pkg/core/embed.go b/go/core/embed.go similarity index 99% rename from pkg/core/embed.go rename to go/core/embed.go index 812ce0d..e6a5766 100644 --- a/pkg/core/embed.go +++ b/go/core/embed.go @@ -224,7 +224,7 @@ func GeneratePack(pkg ScannedPackage) Result { return Result{b.String(), true} } - b.WriteString("import \"dappco.re/go/core/pkg/core\"\n\n") + b.WriteString("import \"dappco.re/go/core\"\n\n") b.WriteString("func init() {\n") // Pack groups (entire directories) diff --git a/pkg/core/error.go b/go/core/error.go similarity index 100% rename from pkg/core/error.go rename to go/core/error.go diff --git a/pkg/core/fs.go b/go/core/fs.go similarity index 100% rename from pkg/core/fs.go rename to go/core/fs.go diff --git a/pkg/core/i18n.go b/go/core/i18n.go similarity index 100% rename from pkg/core/i18n.go rename to go/core/i18n.go diff --git a/pkg/core/ipc.go b/go/core/ipc.go similarity index 100% rename from pkg/core/ipc.go rename to go/core/ipc.go diff --git a/pkg/core/lock.go b/go/core/lock.go similarity index 99% rename from pkg/core/lock.go rename to go/core/lock.go index a8eaac5..a87181d 100644 --- a/pkg/core/lock.go +++ b/go/core/lock.go @@ -16,7 +16,7 @@ var ( // Lock is the DTO for a named mutex. type Lock struct { - Name string + Name string Mutex *sync.RWMutex } diff --git a/pkg/core/log.go b/go/core/log.go similarity index 100% rename from pkg/core/log.go rename to go/core/log.go diff --git a/pkg/core/options.go b/go/core/options.go similarity index 100% rename from pkg/core/options.go rename to go/core/options.go diff --git a/pkg/core/runtime.go b/go/core/runtime.go similarity index 100% rename from pkg/core/runtime.go rename to go/core/runtime.go diff --git a/pkg/core/service.go b/go/core/service.go similarity index 94% rename from pkg/core/service.go rename to go/core/service.go index 4bc9fbd..1e82dd6 100644 --- a/pkg/core/service.go +++ b/go/core/service.go @@ -17,11 +17,11 @@ package core // Service is a managed component with optional lifecycle. type Service struct { - Name string - Options Options - OnStart func() Result - OnStop func() Result - OnReload func() Result + Name string + Options Options + OnStart func() Result + OnStop func() Result + OnReload func() Result } // serviceRegistry holds registered services. diff --git a/pkg/core/string.go b/go/core/string.go similarity index 100% rename from pkg/core/string.go rename to go/core/string.go diff --git a/pkg/core/task.go b/go/core/task.go similarity index 97% rename from pkg/core/task.go rename to go/core/task.go index 8e67ba7..acdf394 100644 --- a/pkg/core/task.go +++ b/go/core/task.go @@ -13,9 +13,9 @@ import ( // TaskState holds background task state. type TaskState struct { Identifier string - Task Task - Result any - Error error + Task Task + Result any + Error error } // PerformAsync dispatches a task in a background goroutine. diff --git a/pkg/core/utils.go b/go/core/utils.go similarity index 100% rename from pkg/core/utils.go rename to go/core/utils.go diff --git a/go.mod b/go/go.mod similarity index 100% rename from go.mod rename to go/go.mod diff --git a/go.sum b/go/go.sum similarity index 100% rename from go.sum rename to go/go.sum diff --git a/tests/app_test.go b/go/tests/app_test.go similarity index 95% rename from tests/app_test.go rename to go/tests/app_test.go index 87a33ec..dc85bff 100644 --- a/tests/app_test.go +++ b/go/tests/app_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/array_test.go b/go/tests/array_test.go similarity index 98% rename from tests/array_test.go rename to go/tests/array_test.go index dba55e9..8212d67 100644 --- a/tests/array_test.go +++ b/go/tests/array_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/cli_test.go b/go/tests/cli_test.go similarity index 98% rename from tests/cli_test.go rename to go/tests/cli_test.go index 6930b6c..1ed18e6 100644 --- a/tests/cli_test.go +++ b/go/tests/cli_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/command_test.go b/go/tests/command_test.go similarity index 99% rename from tests/command_test.go rename to go/tests/command_test.go index e68877f..62be0a9 100644 --- a/tests/command_test.go +++ b/go/tests/command_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/config_test.go b/go/tests/config_test.go similarity index 98% rename from tests/config_test.go rename to go/tests/config_test.go index 4973ca3..47a5836 100644 --- a/tests/config_test.go +++ b/go/tests/config_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/core_test.go b/go/tests/core_test.go similarity index 98% rename from tests/core_test.go rename to go/tests/core_test.go index 14056ab..3b5a68c 100644 --- a/tests/core_test.go +++ b/go/tests/core_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/data_test.go b/go/tests/data_test.go similarity index 99% rename from tests/data_test.go rename to go/tests/data_test.go index d77de02..ffbccea 100644 --- a/tests/data_test.go +++ b/go/tests/data_test.go @@ -5,7 +5,7 @@ import ( "io" "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/drive_test.go b/go/tests/drive_test.go similarity index 98% rename from tests/drive_test.go rename to go/tests/drive_test.go index 882bbdb..8152876 100644 --- a/tests/drive_test.go +++ b/go/tests/drive_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/embed_test.go b/go/tests/embed_test.go similarity index 95% rename from tests/embed_test.go rename to go/tests/embed_test.go index 2b3424f..8531962 100644 --- a/tests/embed_test.go +++ b/go/tests/embed_test.go @@ -7,7 +7,7 @@ import ( "os" "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) @@ -144,7 +144,7 @@ func TestGeneratePack_WithFiles_Good(t *testing.T) { os.MkdirAll(assetDir, 0755) os.WriteFile(assetDir+"/hello.txt", []byte("hello world"), 0644) - source := "package test\nimport \"dappco.re/go/core/pkg/core\"\nfunc example() {\n\t_, _ = core.GetAsset(\"mygroup\", \"hello.txt\")\n}\n" + source := "package test\nimport \"dappco.re/go/core\"\nfunc example() {\n\t_, _ = core.GetAsset(\"mygroup\", \"hello.txt\")\n}\n" goFile := dir + "/test.go" os.WriteFile(goFile, []byte(source), 0644) diff --git a/tests/error_test.go b/go/tests/error_test.go similarity index 99% rename from tests/error_test.go rename to go/tests/error_test.go index 3bc3bab..3d559d9 100644 --- a/tests/error_test.go +++ b/go/tests/error_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/fs_test.go b/go/tests/fs_test.go similarity index 99% rename from tests/fs_test.go rename to go/tests/fs_test.go index d7041b6..447bd42 100644 --- a/tests/fs_test.go +++ b/go/tests/fs_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/i18n_test.go b/go/tests/i18n_test.go similarity index 85% rename from tests/i18n_test.go rename to go/tests/i18n_test.go index db5f423..4520721 100644 --- a/tests/i18n_test.go +++ b/go/tests/i18n_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) @@ -74,10 +74,12 @@ type mockTranslator struct { lang string } -func (m *mockTranslator) Translate(id string, args ...any) Result { return Result{"translated:" + id, true} } -func (m *mockTranslator) SetLanguage(lang string) error { m.lang = lang; return nil } -func (m *mockTranslator) Language() string { return m.lang } -func (m *mockTranslator) AvailableLanguages() []string { return []string{"en", "de", "fr"} } +func (m *mockTranslator) Translate(id string, args ...any) Result { + return Result{"translated:" + id, true} +} +func (m *mockTranslator) SetLanguage(lang string) error { m.lang = lang; return nil } +func (m *mockTranslator) Language() string { return m.lang } +func (m *mockTranslator) AvailableLanguages() []string { return []string{"en", "de", "fr"} } func TestI18n_WithTranslator_Good(t *testing.T) { c := New() diff --git a/tests/ipc_test.go b/go/tests/ipc_test.go similarity index 98% rename from tests/ipc_test.go rename to go/tests/ipc_test.go index a8973f6..7977bbb 100644 --- a/tests/ipc_test.go +++ b/go/tests/ipc_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/lock_test.go b/go/tests/lock_test.go similarity index 97% rename from tests/lock_test.go rename to go/tests/lock_test.go index cf344ed..1c96e42 100644 --- a/tests/lock_test.go +++ b/go/tests/lock_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/log_test.go b/go/tests/log_test.go similarity index 99% rename from tests/log_test.go rename to go/tests/log_test.go index ed91569..1bd5463 100644 --- a/tests/log_test.go +++ b/go/tests/log_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/options_test.go b/go/tests/options_test.go similarity index 98% rename from tests/options_test.go rename to go/tests/options_test.go index 859ce0f..4556062 100644 --- a/tests/options_test.go +++ b/go/tests/options_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/runtime_test.go b/go/tests/runtime_test.go similarity index 98% rename from tests/runtime_test.go rename to go/tests/runtime_test.go index eb5a4f2..10cc848 100644 --- a/tests/runtime_test.go +++ b/go/tests/runtime_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/service_test.go b/go/tests/service_test.go similarity index 98% rename from tests/service_test.go rename to go/tests/service_test.go index 7386e89..0b1a609 100644 --- a/tests/service_test.go +++ b/go/tests/service_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/string_test.go b/go/tests/string_test.go similarity index 98% rename from tests/string_test.go rename to go/tests/string_test.go index d753ff2..5c821ea 100644 --- a/tests/string_test.go +++ b/go/tests/string_test.go @@ -3,7 +3,7 @@ package core_test import ( "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/task_test.go b/go/tests/task_test.go similarity index 97% rename from tests/task_test.go rename to go/tests/task_test.go index 3178ba8..1f62afb 100644 --- a/tests/task_test.go +++ b/go/tests/task_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" ) diff --git a/tests/testdata/cli_clir.go.bak b/go/tests/testdata/cli_clir.go.bak similarity index 100% rename from tests/testdata/cli_clir.go.bak rename to go/tests/testdata/cli_clir.go.bak diff --git a/tests/testdata/scantest/sample.go b/go/tests/testdata/scantest/sample.go similarity index 70% rename from tests/testdata/scantest/sample.go rename to go/tests/testdata/scantest/sample.go index fbd9154..3d58547 100644 --- a/tests/testdata/scantest/sample.go +++ b/go/tests/testdata/scantest/sample.go @@ -1,6 +1,6 @@ package scantest -import "dappco.re/go/core/pkg/core" +import "dappco.re/go/core" func example() { _, _ = core.GetAsset("mygroup", "myfile.txt") diff --git a/tests/testdata/test.txt b/go/tests/testdata/test.txt similarity index 100% rename from tests/testdata/test.txt rename to go/tests/testdata/test.txt diff --git a/tests/utils_test.go b/go/tests/utils_test.go similarity index 99% rename from tests/utils_test.go rename to go/tests/utils_test.go index fafc04a..9b6be9d 100644 --- a/tests/utils_test.go +++ b/go/tests/utils_test.go @@ -4,7 +4,7 @@ import ( "errors" "testing" - . "dappco.re/go/core/pkg/core" + . "dappco.re/go/core" "github.com/stretchr/testify/assert" )