Skip to content

Fix: Make Version dynamically injectable via -ldflags#1106

Open
ParthAggarwal16 wants to merge 1 commit intoowasp-amass:developfrom
ParthAggarwal16:fix/version-ldflags
Open

Fix: Make Version dynamically injectable via -ldflags#1106
ParthAggarwal16 wants to merge 1 commit intoowasp-amass:developfrom
ParthAggarwal16:fix/version-ldflags

Conversation

@ParthAggarwal16
Copy link

Fix for issue #1087
Currently, the Version in Amass is hardcoded as v5.0.0. This PR changes Version to a variable that can be set dynamically at build time using -ldflags.

Changes:
-Replaced const Version = "v5.0.0" with a var Version = "unknown" in internal/afmt/print.go.
-Updated build instructions to allow setting the version with:
go build -ldflags="-X github.com/owasp-amass/amass/v5/internal/afmt.Version=v5.0.1" ./cmd/amass

Here are the outputs :

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant