diff options
author | buglloc <buglloc@yandex-team.com> | 2023-06-08 21:04:23 +0300 |
---|---|---|
committer | buglloc <buglloc@yandex-team.com> | 2023-06-08 21:04:23 +0300 |
commit | 317dbd1daf2f287bf3dbb79648de10e2bf963b78 (patch) | |
tree | 4278ec5dfccd7ab48551c33cd0565044c323306b /build/scripts | |
parent | fbe8270e3157859963c28daa1b4f7750ded631fa (diff) | |
download | ydb-317dbd1daf2f287bf3dbb79648de10e2bf963b78.tar.gz |
More idiomatic vcs info generation for go
1. Добавил стандартный для go коммент про кодген (на него завязаны линтеры и всякие тулы)
2. Выпилил глобальную переменную, кажется в ней нет смысла
Diffstat (limited to 'build/scripts')
-rw-r--r-- | build/scripts/vcs_info.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/build/scripts/vcs_info.py b/build/scripts/vcs_info.py index a3ad16d658..ea32d200b1 100644 --- a/build/scripts/vcs_info.py +++ b/build/scripts/vcs_info.py @@ -244,11 +244,12 @@ def print_go(json_file, output_file): with open(output_file, 'w') as f: f.write('\n'.join([ + '// Code generated by vcs_info.py; DO NOT EDIT.', + '', 'package main', - 'import ("a.yandex-team.ru/library/go/core/buildinfo")', - 'var buildinfomap = map[string]string {'] + gen_map(json_file) + ['}'] + - ['func init() {', - ' buildinfo.InitBuildInfo(buildinfomap)', + 'import "a.yandex-team.ru/library/go/core/buildinfo"', + 'func init() {', + ' buildinfo.InitBuildInfo(map[string]string {'] + gen_map(json_file) + ['})', '}'] ) + '\n') |