open-im-server
open-im-server copied to clipboard
The expectation is for the branch and tag versions to align with the server version
Checklist
- [X] I've searched for similar issues and couldn't find anything matching
- [X] I've discussed this feature request in the OpenIMSDK Slack and got positive feedback
Is this feature request related to a problem?
None
Problem Description
Solution Description
The expectation is for the branch and tag versions to align with the server version, and for the server to print the actual version information upon startup.
Benefits
The expectation is for the branch and tag versions to align with the server version, and for the server to print the actual version information upon startup.
Potential Drawbacks
No response
Additional Information
No response
This issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution! :sparkles:
Join slack π€ to connect and communicate with our developers.
If you wish to accept this assignment, please leave a comment in the comments section: /accept
.π―
/accept
@cubxxw Glad to see you accepted this issueπ€², this issue has been assigned to you. I set the milestones for this issue to , We are looking forward to your PR!
The SemVer specification format is [name]x.y.z-[state+buildmetadata], for example, v2.1.5 and v1.2.3-alpha-1 +001.
go build -ldflags can pass the specified arguments to go tool's link in the format: -ldflags '[pattern=]arg list', for example: -X importpath.name=value. Run go tool link -h:
root@PS2023EVRHNCXG:~/workspaces/openim/Open-IM-Server# go tool link -h | grep "-X"
grep: option requires an argument -- 'X'
Usage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
usage: link [options] main.o
-B note
add an ELF NT_GNU_BUILD_ID note when using ELF
-E entry
set entry symbol name
-H type
set header type
-I linker
use linker as ELF dynamic linker
-L directory
add specified directory to library path
-R quantum
set address rounding quantum (default -1)
-T address
set text segment address (default -1)
-V print version and exit
-X definition
add string value definition of the form importpath.name=value
You can see that -X importpath.name=value tells the Go linker to assign value to the name variable in the importpath package. Note: name must be a string variable, otherwise the compiler will report the following error
go build -ldflags "-X main.GitVersion=v1.0.0 -X main.BuildDate=$(date +%F)" -o version main.go
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
restart
Bot detected the issue body's language is not English, translate it automatically. π―ππ»π§βπ€βπ§π«π§πΏβπ€βπ§π»π©πΎβπ€βπ¨πΏπ¬πΏ
restart
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.