Repository navigation
Commit c9a066e
committed
specs-go: make Version a string literal
Version is initialized during package initialization, which happens on
every start of any program importing this package (for example, runc,
which re-executes itself on every container start and exec). Using
fmt.Sprintf for that takes about 4us and 5 allocations (2920
bytes).
Remove all this, making it a plain string literal. Kept as a variable
rather than a constant, since some users overwrite it, and changing it
to a constant would break them.
Add a test to make sure Version is in sync with the constants, and
update the release checklist accordingly.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>1 parent 73f00a8 commit c9a066e
3 files changed
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
| 64 | + | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | | - | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments