2018-07-29 00:05:24 +00:00
|
|
|
package version
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Run print operation.
|
|
|
|
func Run() error {
|
2018-12-20 23:15:27 +00:00
|
|
|
fmt.Printf("%s\n%s\n", VersionText, GoVersionText)
|
2018-07-29 00:05:24 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
2018-12-20 23:15:27 +00:00
|
|
|
// version is the application version set during build.
|
|
|
|
version string
|
2018-07-29 00:05:24 +00:00
|
|
|
|
2018-12-20 23:15:27 +00:00
|
|
|
// VersionText for directly accessing the static-file-server version.
|
|
|
|
VersionText = fmt.Sprintf("v%s", version)
|
2018-07-29 00:05:24 +00:00
|
|
|
|
|
|
|
// GoVersionText for directly accessing the version of the Go runtime
|
|
|
|
// compiled with the static-file-server.
|
|
|
|
GoVersionText = runtime.Version()
|
|
|
|
)
|