From b2f61655951de451584d2fe38390f4f1e9f2b090 Mon Sep 17 00:00:00 2001 From: Rangel Reale Date: Wed, 27 Dec 2023 07:11:20 -0300 Subject: [PATCH] make compile public --- cmd/cantool/main.go | 3 ++- {internal/generate => pkg/compile}/compile.go | 2 +- {internal/generate => pkg/compile}/compile_test.go | 2 +- {internal/generate => pkg/compile}/file_test.go | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) rename {internal/generate => pkg/compile}/compile.go (99%) rename {internal/generate => pkg/compile}/compile_test.go (99%) rename {internal/generate => pkg/compile}/file_test.go (94%) diff --git a/cmd/cantool/main.go b/cmd/cantool/main.go index 433dacd..ebe4814 100644 --- a/cmd/cantool/main.go +++ b/cmd/cantool/main.go @@ -12,6 +12,7 @@ import ( "github.com/alecthomas/kingpin/v2" "github.com/fatih/color" "go.einride.tech/can/internal/generate" + "go.einride.tech/can/pkg/compile" "go.einride.tech/can/pkg/dbc" "go.einride.tech/can/pkg/dbc/analysis" "go.einride.tech/can/pkg/dbc/analysis/passes/definitiontypeorder" @@ -149,7 +150,7 @@ func genGo(inputFile, outputFile string) error { if err != nil { return err } - result, err := generate.Compile(inputFile, input) + result, err := compile.Compile(inputFile, input) if err != nil { return err } diff --git a/internal/generate/compile.go b/pkg/compile/compile.go similarity index 99% rename from internal/generate/compile.go rename to pkg/compile/compile.go index 767a3fb..17775b8 100644 --- a/internal/generate/compile.go +++ b/pkg/compile/compile.go @@ -1,4 +1,4 @@ -package generate +package compile import ( "fmt" diff --git a/internal/generate/compile_test.go b/pkg/compile/compile_test.go similarity index 99% rename from internal/generate/compile_test.go rename to pkg/compile/compile_test.go index 6aa4592..c712e60 100644 --- a/internal/generate/compile_test.go +++ b/pkg/compile/compile_test.go @@ -1,4 +1,4 @@ -package generate +package compile import ( "os" diff --git a/internal/generate/file_test.go b/pkg/compile/file_test.go similarity index 94% rename from internal/generate/file_test.go rename to pkg/compile/file_test.go index b800aae..f5519e3 100644 --- a/internal/generate/file_test.go +++ b/pkg/compile/file_test.go @@ -1,4 +1,4 @@ -package generate +package compile import ( "os"