Skip to content

Commit 55a0107

Browse files
echistyakovfacebook-github-bot
authored andcommitted
Extract auto-generated header
Summary: For consistency with other languages: https://www.internalfb.com/code/fbsource/[dff85bff3a69]/xplat/thrift/compiler/generate/templates/py3/common/auto_generated_c.mustache?lines=1 https://www.internalfb.com/code/fbsource/[dff85bff3a69]/xplat/thrift/compiler/generate/templates/py3/common/auto_generated_py.mustache?lines=1 https://www.internalfb.com/code/fbsource/[dff85bff3a69]/xplat/thrift/compiler/generate/templates/cpp2/Autogen.mustache?lines=1 Plus - `common/header.mustache` is just a bad name - it doesn't describe its contents of the template well. `common/auto_generated_go.mustache` is much better. Reviewed By: podtserkovskiy Differential Revision: D79909530 fbshipit-source-id: 05ace7ece8b5630569f51829e89aac88d088ae28
1 parent d34b877 commit 55a0107

File tree

41 files changed

+21
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+21
-44
lines changed

third-party/thrift/src/thrift/compiler/generate/templates/go/codec.go.mustache

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@
2222
The workaround is to create slice literals (one with keys, one with values),
2323
create an empty map during runtime and populate that map from the two slices.
2424
25-
}}{{> common/header}}
25+
}}
26+
{{> common/auto_generated_go}}
27+
28+
package {{program:go_pkg_name}}
2629

2730
import (
2831
{{#program:thrift_imports}}

third-party/thrift/src/thrift/compiler/generate/templates/go/common/header.mustache renamed to third-party/thrift/src/thrift/compiler/generate/templates/go/common/auto_generated_go.mustache

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
17-
}}{{!
18-
}}// Autogenerated by Thrift for {{program:autogen_path}}{{service:autogen_path}}
17+
}}
18+
// Autogenerated by Thrift for {{program:autogen_path}}{{service:autogen_path}}
1919
//
2020
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
2121
// @{{!}}generated
22-
23-
package {{program:go_pkg_name}}
2422
{{!newline}}

third-party/thrift/src/thrift/compiler/generate/templates/go/const.go.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
limitations under the License.
1616
1717
}}
18-
{{> common/header}}
18+
{{> common/auto_generated_go}}
19+
20+
package {{program:go_pkg_name}}
1921

2022
import (
2123
{{#program:thrift_imports}}

third-party/thrift/src/thrift/compiler/generate/templates/go/doc.go.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@
1717
{{#program:docs?}}
1818
{{program:docs}}
1919
{{/program:docs?}}
20-
{{> common/header}}
20+
{{> common/auto_generated_go}}
21+
22+
package {{program:go_pkg_name}}

third-party/thrift/src/thrift/compiler/generate/templates/go/metadata.go.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
create an empty map during runtime and populate that map from the two slices.
2424
2525
}}
26-
{{> common/header}}
26+
{{> common/auto_generated_go}}
27+
28+
package {{program:go_pkg_name}}
2729

2830
import (
2931
"maps"

third-party/thrift/src/thrift/compiler/generate/templates/go/svcs.go.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
limitations under the License.
1515
1616
}}
17-
{{> common/header}}
17+
{{> common/auto_generated_go}}
18+
19+
package {{program:go_pkg_name}}
1820

1921
import (
2022
"context"

third-party/thrift/src/thrift/compiler/generate/templates/go/types.go.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
limitations under the License.
1515
1616
}}
17-
{{> common/header}}
17+
{{> common/auto_generated_go}}
18+
19+
package {{program:go_pkg_name}}
1820

1921
import (
2022
"fmt"

third-party/thrift/src/thrift/compiler/test/fixtures/adapter/out/go/gen-go/codec.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package module
77

8-
98
import (
109
thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
1110
)

third-party/thrift/src/thrift/compiler/test/fixtures/basic-annotations/out/go/gen-go/codec.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package module
77

8-
98
import (
109
thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
1110
)

third-party/thrift/src/thrift/compiler/test/fixtures/basic/out/go/gen-go/codec.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package module
77

8-
98
import (
109
thrift "github.com/facebook/fbthrift/thrift/lib/go/thrift/types"
1110
)

0 commit comments

Comments
 (0)