From 976efb6580178fb755928fc55bf0f41aa192767c Mon Sep 17 00:00:00 2001 From: Achille Roussel Date: Mon, 25 Sep 2023 15:57:45 -0700 Subject: [PATCH] generated => durable Signed-off-by: Achille Roussel --- compiler/Makefile | 9 ++++----- compiler/compile.go | 2 +- .../{coroutine_generated.go => coroutine_durable.go} | 0 .../testdata/http/{main_generated.go => main_durable.go} | 0 .../{testdata_generated.go => testdata_durable.go} | 0 5 files changed, 5 insertions(+), 6 deletions(-) rename compiler/testdata/{coroutine_generated.go => coroutine_durable.go} (100%) rename compiler/testdata/http/{main_generated.go => main_durable.go} (100%) rename compiler/testdata/{testdata_generated.go => testdata_durable.go} (100%) diff --git a/compiler/Makefile b/compiler/Makefile index d557f01..0658854 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -1,8 +1,7 @@ GO ?= go -TARGET = \ - testdata/coroutine_generated.go \ - testdata/testdata_generated.go +testdata.source = testdata/coroutine.go testdata/testdata.go +testdata.target = $(testdata.source:.go=_durable.go) test: clean generate $(GO) test ./... @@ -10,12 +9,12 @@ test: clean generate generate: coroc PATH="$$(pwd):$$PATH" $(GO) generate ./testdata - $(GO) fmt $(TARGET) || exit 0 + $(GO) fmt $(testdata.target) || exit 0 coroc: $(GO) build -o $@ ./cmd/coroc clean: - $(RM) coroc $(TARGET) + $(RM) coroc $(testdata.target) .PHONY: clean generate test diff --git a/compiler/compile.go b/compiler/compile.go index 96b49ec..3b5f10c 100644 --- a/compiler/compile.go +++ b/compiler/compile.go @@ -282,7 +282,7 @@ func (c *compiler) compilePackage(p *packages.Package, colors functionColors) er gen = addImports(p, gen) outputPath := strings.TrimSuffix(p.GoFiles[i], ".go") - outputPath += "_generated.go" + outputPath += "_durable.go" if err := c.writeFile(outputPath, gen, func(expr constraint.Expr) constraint.Expr { return withBuildTag(expr, buildTag) diff --git a/compiler/testdata/coroutine_generated.go b/compiler/testdata/coroutine_durable.go similarity index 100% rename from compiler/testdata/coroutine_generated.go rename to compiler/testdata/coroutine_durable.go diff --git a/compiler/testdata/http/main_generated.go b/compiler/testdata/http/main_durable.go similarity index 100% rename from compiler/testdata/http/main_generated.go rename to compiler/testdata/http/main_durable.go diff --git a/compiler/testdata/testdata_generated.go b/compiler/testdata/testdata_durable.go similarity index 100% rename from compiler/testdata/testdata_generated.go rename to compiler/testdata/testdata_durable.go