maddy/cmd/maddyctl/version.go
fox.cpp ae6decd876
Redesign imapsql-ctl utility (now named maddyctl)
Now it is not tied go-imap-sql details (with the exception of special
features), allowing it to be used with other storage backends that will
be added in the future.

--unsafe flag is removed and now maddyctl explicitly asks for
confirmation in cases where transaction may be unsafe for connected
clients. --yes flag disables that. In the future, maddy can be
extended with IPC interface to push updates so it this restriction
can be lifted altogether.
2019-10-20 01:50:07 +03:00

16 lines
309 B
Go

package main
import (
"fmt"
"runtime/debug"
)
func buildInfo() string {
if info, ok := debug.ReadBuildInfo(); ok {
if info.Main.Version == "(devel)" {
return "unknown (built from source tree)"
}
return fmt.Sprintf("%s %s", info.Main.Version, info.Main.Sum)
}
return "unknown (GOPATH build)"
}