diff --git a/cmd/go-tr/main.go b/cmd/go-tr/main.go index 6a294e5..0fe57f6 100644 --- a/cmd/go-tr/main.go +++ b/cmd/go-tr/main.go @@ -3,8 +3,8 @@ package main import ( "flag" "fmt" - "my/go-translator/transpile" - "my/go-translator/transpile_python" + "my/go-translator/pkg/service" + "my/go-translator/pkg/service_python" "os" ) @@ -84,7 +84,7 @@ func safeTranspile(mode int, source, target, header_file string, addArduinoH boo switch mode { case CPP_MODE: // Transpiles the Golang source into Arduino sketch. - service := transpile.NewService(in, out) + service := service.NewService(in, out) service.SetHeaderWriter(header_f) service.AddIncludeArduinoH(addArduinoH) if err := service.Start(); err != nil { @@ -92,7 +92,7 @@ func safeTranspile(mode int, source, target, header_file string, addArduinoH boo os.Exit(1) } case PYTHON_MODE: - service := transpile_python.NewService(in, out) + service := service_python.NewService(in, out) if err := service.Start(); err != nil { fmt.Fprintf(os.Stderr, "%v", err) os.Exit(1) diff --git a/transpile/mapping.go b/pkg/service/mapping.go similarity index 99% rename from transpile/mapping.go rename to pkg/service/mapping.go index 50658a4..f75d08e 100644 --- a/transpile/mapping.go +++ b/pkg/service/mapping.go @@ -1,4 +1,4 @@ -package transpile +package service var mapping = map[string]string{ "digital.Low": "LOW", diff --git a/transpile/service.go b/pkg/service/service.go similarity index 99% rename from transpile/service.go rename to pkg/service/service.go index 10068a3..c361810 100644 --- a/transpile/service.go +++ b/pkg/service/service.go @@ -1,4 +1,4 @@ -package transpile +package service import ( "fmt" diff --git a/transpile/service_test.go b/pkg/service/service_test.go similarity index 99% rename from transpile/service_test.go rename to pkg/service/service_test.go index 616b384..e190322 100644 --- a/transpile/service_test.go +++ b/pkg/service/service_test.go @@ -1,4 +1,4 @@ -package transpile +package service import ( "bytes" diff --git a/transpile_python/mapping.go b/pkg/service_python/mapping.go similarity index 99% rename from transpile_python/mapping.go rename to pkg/service_python/mapping.go index 0d18a99..5438e9f 100644 --- a/transpile_python/mapping.go +++ b/pkg/service_python/mapping.go @@ -1,4 +1,4 @@ -package transpile_python +package service_python var mapping = map[string]string{ "digital.Low": "LOW", diff --git a/transpile_python/service.go b/pkg/service_python/service.go similarity index 99% rename from transpile_python/service.go rename to pkg/service_python/service.go index a2a6c49..e65a597 100644 --- a/transpile_python/service.go +++ b/pkg/service_python/service.go @@ -1,4 +1,4 @@ -package transpile_python +package service_python import ( "fmt" diff --git a/transpile_python/service_test.go b/pkg/service_python/service_test.go similarity index 99% rename from transpile_python/service_test.go rename to pkg/service_python/service_test.go index 4af55bb..d2218bb 100644 --- a/transpile_python/service_test.go +++ b/pkg/service_python/service_test.go @@ -1,4 +1,4 @@ -package transpile_python +package service_python import ( "bytes"