From 062dcf7007343cdb46eb7986b0a78458c9a7a157 Mon Sep 17 00:00:00 2001 From: kostya-sh Date: Wed, 3 Oct 2018 19:19:40 +0100 Subject: [PATCH] Use standard header for generated Go files (#4961) As recommended by https://golang.org/pkg/cmd/go/internal/generate/: To convey to humans and machine tools that code is generated, generated source should have a line early in the file that matches the following regular expression (in Go syntax): ^// Code generated .* DO NOT EDIT\.$ --- src/idl_gen_go.cpp | 2 +- tests/MyGame/Example/Ability.go | 2 +- tests/MyGame/Example/Any.go | 2 +- tests/MyGame/Example/Color.go | 2 +- tests/MyGame/Example/Monster.go | 2 +- tests/MyGame/Example/Referrable.go | 2 +- tests/MyGame/Example/Stat.go | 2 +- tests/MyGame/Example/Test.go | 2 +- tests/MyGame/Example/TestSimpleTableWithEnum.go | 2 +- tests/MyGame/Example/TypeAliases.go | 2 +- tests/MyGame/Example/Vec3.go | 2 +- tests/MyGame/Example2/Monster.go | 2 +- tests/MyGame/InParentNamespace.go | 2 +- tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go | 2 +- tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go | 2 +- tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go | 2 +- tests/namespace_test/NamespaceA/SecondTableInA.go | 2 +- tests/namespace_test/NamespaceA/TableInFirstNS.go | 2 +- tests/namespace_test/NamespaceC/TableInC.go | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/idl_gen_go.cpp b/src/idl_gen_go.cpp index 4f20719..48b643d 100644 --- a/src/idl_gen_go.cpp +++ b/src/idl_gen_go.cpp @@ -782,7 +782,7 @@ class GoGenerator : public BaseGenerator { void BeginFile(const std::string name_space_name, const bool needs_imports, std::string *code_ptr) { std::string &code = *code_ptr; - code = code + "// " + FlatBuffersGeneratedWarning() + "\n\n"; + code = code + "// Code generated by the FlatBuffers compiler. DO NOT EDIT.\n\n"; code += "package " + name_space_name + "\n\n"; if (needs_imports) { code += "import (\n"; diff --git a/tests/MyGame/Example/Ability.go b/tests/MyGame/Example/Ability.go index 2ea8665..a56b445 100644 --- a/tests/MyGame/Example/Ability.go +++ b/tests/MyGame/Example/Ability.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example/Any.go b/tests/MyGame/Example/Any.go index 06c238e..39b89a7 100644 --- a/tests/MyGame/Example/Any.go +++ b/tests/MyGame/Example/Any.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example/Color.go b/tests/MyGame/Example/Color.go index 7318cbc..cc08334 100644 --- a/tests/MyGame/Example/Color.go +++ b/tests/MyGame/Example/Color.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example/Monster.go b/tests/MyGame/Example/Monster.go index 4cab6b8..3551428 100644 --- a/tests/MyGame/Example/Monster.go +++ b/tests/MyGame/Example/Monster.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example/Referrable.go b/tests/MyGame/Example/Referrable.go index 1fae186..0fb06fb 100644 --- a/tests/MyGame/Example/Referrable.go +++ b/tests/MyGame/Example/Referrable.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example/Stat.go b/tests/MyGame/Example/Stat.go index 9abc558..401712f 100644 --- a/tests/MyGame/Example/Stat.go +++ b/tests/MyGame/Example/Stat.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example/Test.go b/tests/MyGame/Example/Test.go index cb283fb..53f53fd 100644 --- a/tests/MyGame/Example/Test.go +++ b/tests/MyGame/Example/Test.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example/TestSimpleTableWithEnum.go b/tests/MyGame/Example/TestSimpleTableWithEnum.go index 0704b70..559cd1f 100644 --- a/tests/MyGame/Example/TestSimpleTableWithEnum.go +++ b/tests/MyGame/Example/TestSimpleTableWithEnum.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example/TypeAliases.go b/tests/MyGame/Example/TypeAliases.go index c64c287..f3d6b84 100644 --- a/tests/MyGame/Example/TypeAliases.go +++ b/tests/MyGame/Example/TypeAliases.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example/Vec3.go b/tests/MyGame/Example/Vec3.go index a880a40..f18fc27 100644 --- a/tests/MyGame/Example/Vec3.go +++ b/tests/MyGame/Example/Vec3.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example diff --git a/tests/MyGame/Example2/Monster.go b/tests/MyGame/Example2/Monster.go index 79949b9..d0fae94 100644 --- a/tests/MyGame/Example2/Monster.go +++ b/tests/MyGame/Example2/Monster.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package Example2 diff --git a/tests/MyGame/InParentNamespace.go b/tests/MyGame/InParentNamespace.go index 341b05c..fc6ce32 100644 --- a/tests/MyGame/InParentNamespace.go +++ b/tests/MyGame/InParentNamespace.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package MyGame diff --git a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go index a7f2365..797ea67 100644 --- a/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go +++ b/tests/namespace_test/NamespaceA/NamespaceB/EnumInNestedNS.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package NamespaceB diff --git a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go index 00840aa..e985fbf 100644 --- a/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go +++ b/tests/namespace_test/NamespaceA/NamespaceB/StructInNestedNS.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package NamespaceB diff --git a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go index 0e767b8..75f7a55 100644 --- a/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go +++ b/tests/namespace_test/NamespaceA/NamespaceB/TableInNestedNS.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package NamespaceB diff --git a/tests/namespace_test/NamespaceA/SecondTableInA.go b/tests/namespace_test/NamespaceA/SecondTableInA.go index bd691e8..3fea3a8 100644 --- a/tests/namespace_test/NamespaceA/SecondTableInA.go +++ b/tests/namespace_test/NamespaceA/SecondTableInA.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package NamespaceA diff --git a/tests/namespace_test/NamespaceA/TableInFirstNS.go b/tests/namespace_test/NamespaceA/TableInFirstNS.go index b3354d3..82f57c3 100644 --- a/tests/namespace_test/NamespaceA/TableInFirstNS.go +++ b/tests/namespace_test/NamespaceA/TableInFirstNS.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package NamespaceA diff --git a/tests/namespace_test/NamespaceC/TableInC.go b/tests/namespace_test/NamespaceC/TableInC.go index 7e6c733..5cd30da 100644 --- a/tests/namespace_test/NamespaceC/TableInC.go +++ b/tests/namespace_test/NamespaceC/TableInC.go @@ -1,4 +1,4 @@ -// automatically generated by the FlatBuffers compiler, do not modify +// Code generated by the FlatBuffers compiler. DO NOT EDIT. package NamespaceC -- 2.7.4