-
Notifications
You must be signed in to change notification settings - Fork 920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use embedded files instead of ldflags to get the build info during runtime #2421
Closed
Closed
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1e6afc9
feat: use of embed to add the version info - we're missing the values…
tty47 0a1776d
fix: add EOF
tty47 ce37cce
feat: rename make
tty47 35ffb82
fix: typo
tty47 8364c57
fix: ignore during tests
tty47 679d0f5
feat: use go:buid version >go17 - commenst to the embed
tty47 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,6 @@ vendor | |
/cel-key | ||
coverage.txt | ||
go.work | ||
|
||
# embedded files | ||
cmd/celestia/*.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
// +build: !test | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"runtime" | ||
|
||
_ "embed" | ||
|
||
"github.com/spf13/cobra" | ||
) | ||
|
||
var ( | ||
buildTime string | ||
lastCommit string | ||
buildTime string | ||
//go:embed lastCommit.txt | ||
Check failure on line 15 in cmd/celestia/version.go GitHub Actions / go-ci / Unit Tests Coverage
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to document this lastCommit.txt here.
And exclude it from the the go test executor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my commetn