mirror of
https://github.com/restic/rest-server.git
synced 2025-10-19 15:43:21 +00:00
Report version on startup
This commit is contained in:
parent
0f4373ed7f
commit
c228f57ddf
1 changed files with 5 additions and 0 deletions
5
main.go
5
main.go
|
@ -5,6 +5,7 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"runtime/pprof"
|
"runtime/pprof"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -74,9 +75,13 @@ func setupMux() *goji.Mux {
|
||||||
return mux
|
return mux
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var version = "manually"
|
||||||
|
|
||||||
func runRoot(cmd *cobra.Command, args []string) error {
|
func runRoot(cmd *cobra.Command, args []string) error {
|
||||||
log.SetFlags(0)
|
log.SetFlags(0)
|
||||||
|
|
||||||
|
log.Printf("rest-server %s compiled with %v on %v/%v\n", version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
||||||
|
|
||||||
if config.cpuprofile != "" {
|
if config.cpuprofile != "" {
|
||||||
f, err := os.Create(config.cpuprofile)
|
f, err := os.Create(config.cpuprofile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue