From 0df69edbbb2978f52ecfd424a0342e23acfb245c Mon Sep 17 00:00:00 2001 From: Chuntao Lu Date: Tue, 28 Jul 2020 19:50:16 -0700 Subject: [PATCH 1/3] Explicit import alias for zanzibar runtime in templates --- codegen/templates/main.tmpl | 2 +- codegen/templates/main_test.tmpl | 2 +- codegen/templates/service.tmpl | 2 +- codegen/templates/service_mock.tmpl | 2 +- codegen/templates/structs.tmpl | 2 +- codegen/templates/tchannel_client_test_server.tmpl | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/codegen/templates/main.tmpl b/codegen/templates/main.tmpl index 0e253b6d3..9e8b13d41 100644 --- a/codegen/templates/main.tmpl +++ b/codegen/templates/main.tmpl @@ -16,7 +16,7 @@ import ( _ "go.uber.org/automaxprocs" "github.com/uber/zanzibar/config" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" app "{{$instance.PackageInfo.PackageRoot}}" service "{{$instance.PackageInfo.GeneratedPackagePath}}" diff --git a/codegen/templates/main_test.tmpl b/codegen/templates/main_test.tmpl index d3099c2d7..c17e25e48 100644 --- a/codegen/templates/main_test.tmpl +++ b/codegen/templates/main_test.tmpl @@ -15,7 +15,7 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" module "{{$instance.PackageInfo.ModulePackagePath}}" ) diff --git a/codegen/templates/service.tmpl b/codegen/templates/service.tmpl index fd73361a9..b104657b1 100644 --- a/codegen/templates/service.tmpl +++ b/codegen/templates/service.tmpl @@ -8,7 +8,7 @@ import ( "path/filepath" "go.uber.org/zap" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" module "{{$instance.PackageInfo.ModulePackagePath}}" ) diff --git a/codegen/templates/service_mock.tmpl b/codegen/templates/service_mock.tmpl index c74452a39..48a3999a6 100644 --- a/codegen/templates/service_mock.tmpl +++ b/codegen/templates/service_mock.tmpl @@ -19,7 +19,7 @@ import ( "github.com/golang/mock/gomock" "github.com/uber/zanzibar/config" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" service "{{$instance.PackageInfo.GeneratedPackagePath}}" ) diff --git a/codegen/templates/structs.tmpl b/codegen/templates/structs.tmpl index adc6a606b..e95a354e0 100644 --- a/codegen/templates/structs.tmpl +++ b/codegen/templates/structs.tmpl @@ -7,7 +7,7 @@ import ( "runtime" "path/filepath" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" {{range $idx, $pkg := .Spec.IncludedPackages -}} {{$pkg.AliasName}} "{{$pkg.PackageName}}" {{end}} diff --git a/codegen/templates/tchannel_client_test_server.tmpl b/codegen/templates/tchannel_client_test_server.tmpl index 1646aca2a..4c3cfa3e4 100644 --- a/codegen/templates/tchannel_client_test_server.tmpl +++ b/codegen/templates/tchannel_client_test_server.tmpl @@ -7,7 +7,7 @@ import ( "errors" "time" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" "go.uber.org/thriftrw/wire" {{range $idx, $pkg := .IncludedPackages -}} From 429e7d1d078cd9e16a630a6674a73229d3a7d266 Mon Sep 17 00:00:00 2001 From: Chuntao Lu Date: Tue, 28 Jul 2020 19:53:26 -0700 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be1cef6eb..39ea6cf24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 0.6.3 - 2020-07-27 +## 0.6.4 - 2020-07-27 ### Added - Added support for fetching multiple header values. https://github.com/uber/zanzibar/pull/733. +- Set explicit import alias for github.com/uber/zanzibar/runtime in templates. https://github.com/uber/zanzibar/pull/734. ## 0.6.2 - 2020-07-17 ### Added From d54fdbac7d60faf04683f7a913ef8b7f0a1f6e19 Mon Sep 17 00:00:00 2001 From: Chuntao Lu Date: Tue, 28 Jul 2020 20:22:46 -0700 Subject: [PATCH 3/3] Check in generated files --- codegen/template_bundle/template_files.go | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/codegen/template_bundle/template_files.go b/codegen/template_bundle/template_files.go index d6fcfcfde..cde2915fd 100644 --- a/codegen/template_bundle/template_files.go +++ b/codegen/template_bundle/template_files.go @@ -1873,7 +1873,7 @@ import ( _ "go.uber.org/automaxprocs" "github.com/uber/zanzibar/config" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" app "{{$instance.PackageInfo.PackageRoot}}" service "{{$instance.PackageInfo.GeneratedPackagePath}}" @@ -1965,7 +1965,7 @@ func mainTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "main.tmpl", size: 1795, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "main.tmpl", size: 1804, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -1987,7 +1987,7 @@ import ( "go.uber.org/zap" "go.uber.org/zap/zapcore" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" module "{{$instance.PackageInfo.ModulePackagePath}}" ) @@ -2061,7 +2061,7 @@ func main_testTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "main_test.tmpl", size: 1348, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "main_test.tmpl", size: 1357, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2418,7 +2418,7 @@ import ( "path/filepath" "go.uber.org/zap" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" module "{{$instance.PackageInfo.ModulePackagePath}}" ) @@ -2472,7 +2472,7 @@ func serviceTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "service.tmpl", size: 1436, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "service.tmpl", size: 1445, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2498,7 +2498,7 @@ import ( "github.com/golang/mock/gomock" "github.com/uber/zanzibar/config" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" service "{{$instance.PackageInfo.GeneratedPackagePath}}" ) @@ -2688,7 +2688,7 @@ func service_mockTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "service_mock.tmpl", size: 5394, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "service_mock.tmpl", size: 5403, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -2702,7 +2702,7 @@ import ( "runtime" "path/filepath" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" {{range $idx, $pkg := .Spec.IncludedPackages -}} {{$pkg.AliasName}} "{{$pkg.PackageName}}" {{end}} @@ -2724,7 +2724,7 @@ func structsTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "structs.tmpl", size: 436, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "structs.tmpl", size: 445, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -3071,7 +3071,7 @@ import ( "errors" "time" - "github.com/uber/zanzibar/runtime" + zanzibar "github.com/uber/zanzibar/runtime" "go.uber.org/thriftrw/wire" {{range $idx, $pkg := .IncludedPackages -}} @@ -3176,7 +3176,7 @@ func tchannel_client_test_serverTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tchannel_client_test_server.tmpl", size: 3014, mode: os.FileMode(420), modTime: time.Unix(1, 0)} + info := bindataFileInfo{name: "tchannel_client_test_server.tmpl", size: 3023, mode: os.FileMode(420), modTime: time.Unix(1, 0)} a := &asset{bytes: bytes, info: info} return a, nil }