insert buildinfo at compile time #1

Closed
opened 2022-08-29 02:40:10 +02:00 by milarin · 0 comments
Owner

Use ldflags to insert compile time data

adding custom data at compile data

fill fields in buildinfo with data

Let gocc retrieve all data:

  • Name: ProjectName variable
  • Version: git log -n 1 --pretty="format:%(describe:tags)" (might be null if no tag available)
  • Commit: git log -n 1 --pretty="format:%H"
  • BuildTime: time.Now()

make variable paths for ldflags arguments customizable so that the usage of buildinfo is not forced

Use ldflags to insert compile time data [adding custom data at compile data](https://goenning.net/2017/01/25/adding-custom-data-go-binaries-compile-time/) fill fields in [buildinfo](https://git.milar.in/milarin/buildinfo) with data Let `gocc` retrieve all data: - Name: `ProjectName` variable - Version: `git log -n 1 --pretty="format:%(describe:tags)"` (might be null if no tag available) - Commit: `git log -n 1 --pretty="format:%H"` - BuildTime: `time.Now()` make variable paths for `ldflags` arguments customizable so that the usage of [buildinfo](https://git.milar.in/milarin/buildinfo) is not forced
milarin added the
enhancement
label 2022-08-29 02:40:14 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: milarin/gocc#1
No description provided.