Skip to content

Commit 604b8be

Browse files
echistyakovfacebook-github-bot
authored andcommitted
Remove doc.go
Summary: 1. Reduce file clutter. Having a separate `doc.go` file is unnecessary - just an additional file to take up space. 2. `doc.go` is not idiomatic. Go recommends putting package level comment in one of the source files, right before `package` statement: https://tip.golang.org/doc/comment#package 3. `doc.go` was not even included into `thrift_library` build - so users were not even getting access to the package level comment: https://www.internalfb.com/code/fbsource/[2b32460319ab]/tools/build_defs/fbcode_macros/build_defs/lib/thrift/go.bzl?lines=49-54 This diff removes `doc.go` and move the package level comment into `svcs.go` (right before `package` statement - as recommended by Go style guide). Reviewed By: podtserkovskiy Differential Revision: D79910278 fbshipit-source-id: ebffddf6f867573013ac02aaa7ccebec32140d8d
1 parent 55a0107 commit 604b8be

File tree

27 files changed

+25
-415
lines changed

27 files changed

+25
-415
lines changed

third-party/thrift/src/thrift/compiler/generate/t_mstch_go_generator.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,6 @@ void t_mstch_go_generator::generate_program() {
856856
if (data_.gen_metadata) {
857857
render_to_file(prog, "metadata.go", "metadata.go");
858858
}
859-
if (program->has_doc()) {
860-
render_to_file(prog, "doc.go", "doc.go");
861-
}
862859
}
863860

864861
void t_mstch_go_generator::set_mstch_factories() {

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

Lines changed: 0 additions & 22 deletions
This file was deleted.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
}}
1717
{{> common/auto_generated_go}}
1818

19+
{{#program:docs?}}
20+
{{program:docs}}
21+
{{/program:docs?}}
1922
package {{program:go_pkg_name}}
2023

2124
import (

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

Lines changed: 0 additions & 22 deletions
This file was deleted.

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

Lines changed: 0 additions & 22 deletions
This file was deleted.

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

Lines changed: 0 additions & 22 deletions
This file was deleted.

third-party/thrift/src/thrift/compiler/test/fixtures/complex-union/out/go/gen-go/doc.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

third-party/thrift/src/thrift/compiler/test/fixtures/default_values/out/go/gen-go/doc.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_before/out/go/gen-go/doc.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

third-party/thrift/src/thrift/compiler/test/fixtures/doctext/out/cpp2/gen-cpp2/C.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class ServiceHandler<::cpp2::C> : public apache::thrift::ServerInterface {
8787
namespace detail {
8888
template <> struct TSchemaAssociation<::cpp2::C, false> {
8989
static ::folly::Range<const ::std::string_view*>(*bundle)();
90-
static constexpr int64_t programId = -2642339036077964808;
91-
static constexpr ::std::string_view definitionKey = {"\x17\x8c\x04\xf5\x38\x9f\xfe\xa5\x44\x93\x1e\xe9\xca\x4c\xa8\xa7", 16};
90+
static constexpr int64_t programId = -8518854100704916787;
91+
static constexpr ::std::string_view definitionKey = {"\x3f\x6e\x14\x31\x82\xa7\x8d\xe4\xd6\xd5\x06\xf6\xf9\x4e\x9c\xbf", 16};
9292
};
9393
}
9494
} // namespace apache::thrift

0 commit comments

Comments
 (0)