Commit 87f4a99
committed
Support setting version string via ldflags
When xcaddy is built directly from source (e.g. distro packaging),
Go's debug.ReadBuildInfo() reports the main module version as
"(devel)" rather than the actual release version. The upstream
build process works around this by building from a separate wrapper
module that imports xcaddy as a versioned dependency, but packagers
typically build directly from the source tarball.
Add a version variable that can be set via -ldflags -X at build
time, allowing packagers to inject the correct version string.1 parent 14e0e39 commit 87f4a99
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
207 | 212 | | |
208 | 213 | | |
209 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
210 | 218 | | |
211 | 219 | | |
212 | 220 | | |
| |||
0 commit comments