From 94d683d222cb3a51c8cf0f6b1e370bd2a75fceaa Mon Sep 17 00:00:00 2001 From: Aleksandr Razumov Date: Sun, 6 Dec 2020 02:37:53 +0300 Subject: [PATCH] feat(gen): use "gen" postfix for generated client Fix #6 --- cmd/gotdgen/main.go | 2 +- internal/gen/example/{tl_client.go => tl_client_gen.go} | 0 internal/gen/write_source.go | 2 +- internal/mt/{tl_client.go => tl_client_gen.go} | 0 tg/{tl_client.go => tl_client_gen.go} | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename internal/gen/example/{tl_client.go => tl_client_gen.go} (100%) rename internal/mt/{tl_client.go => tl_client_gen.go} (100%) rename tg/{tl_client.go => tl_client_gen.go} (100%) diff --git a/cmd/gotdgen/main.go b/cmd/gotdgen/main.go index 77f3977c37..e991896040 100644 --- a/cmd/gotdgen/main.go +++ b/cmd/gotdgen/main.go @@ -68,7 +68,7 @@ func main() { if !strings.HasSuffix(name, "_gen.go") { continue } - if !strings.HasPrefix(name, "tl_") && name != "rpc_gen.go" { + if !strings.HasPrefix(name, "tl_") { continue } if err := os.Remove(filepath.Join(*targetDir, name)); err != nil { diff --git a/internal/gen/example/tl_client.go b/internal/gen/example/tl_client_gen.go similarity index 100% rename from internal/gen/example/tl_client.go rename to internal/gen/example/tl_client_gen.go diff --git a/internal/gen/write_source.go b/internal/gen/write_source.go index 6ea940b6ab..adf49e6f93 100644 --- a/internal/gen/write_source.go +++ b/internal/gen/write_source.go @@ -91,7 +91,7 @@ func (g *Generator) WriteSource(fs FileSystem, pkgName string, t *template.Templ if err := t.ExecuteTemplate(buf, "client", cfg); err != nil { return err } - if err := fs.WriteFile("tl_client.go", buf.Bytes()); err != nil { + if err := fs.WriteFile("tl_client_gen.go", buf.Bytes()); err != nil { return err } diff --git a/internal/mt/tl_client.go b/internal/mt/tl_client_gen.go similarity index 100% rename from internal/mt/tl_client.go rename to internal/mt/tl_client_gen.go diff --git a/tg/tl_client.go b/tg/tl_client_gen.go similarity index 100% rename from tg/tl_client.go rename to tg/tl_client_gen.go