mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
Add git commit to the version output. (#900)
Now the output would be:
```
./coredns -version
CoreDNS-010
linux/amd64, go1.8, 241e3db
```
In case the local file has been modified, then the output would be (with --dirty):
```
./coredns -version
CoreDNS-010
linux/amd64, go1.8, 241e3db-dirty
```
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -168,7 +168,7 @@ func showVersion() {
|
||||
|
||||
// versionString returns the CoreDNS version as a string.
|
||||
func versionString() string {
|
||||
return fmt.Sprintf("%s-%s\n", caddy.AppName, caddy.AppVersion)
|
||||
return fmt.Sprintf("%s-%s\n%s/%s, %s, %s\n", caddy.AppName, caddy.AppVersion, runtime.GOOS, runtime.GOARCH, runtime.Version(), gitCommit)
|
||||
}
|
||||
|
||||
// setVersion figures out the version information
|
||||
|
||||
Reference in New Issue
Block a user