Commit 3268958e0767d438714c3cd719deaedada1a1867

Authored by Georg Hopp
1 parent 43d200f7

Print all registered package versions

Showing 1 changed file with 2 additions and 7 deletions
@@ -32,6 +32,7 @@ import ( @@ -32,6 +32,7 @@ import (
32 "strings" 32 "strings"
33 33
34 "gitlab.weird-web-workers.org/golang/logger" 34 "gitlab.weird-web-workers.org/golang/logger"
  35 + "gitlab.weird-web-workers.org/golang/version"
35 ) 36 )
36 37
37 type ApiHandler struct { 38 type ApiHandler struct {
@@ -58,13 +59,7 @@ func (handler *ApiHandler) ServeHTTP( @@ -58,13 +59,7 @@ func (handler *ApiHandler) ServeHTTP(
58 dirs := strings.Split(request.URL.Path, "/") 59 dirs := strings.Split(request.URL.Path, "/")
59 switch dirs[0] { 60 switch dirs[0] {
60 case "version": 61 case "version":
61 - v, err := json.Marshal(  
62 - version{  
63 - VERSION,  
64 - REVISION,  
65 - BUILD_TIME,  
66 - },  
67 - ) 62 + v, err := version.Versions.Json()
68 if err != nil { 63 if err != nil {
69 http.Error(response, "Unable to encode version information", 500) 64 http.Error(response, "Unable to encode version information", 500)
70 return 65 return
Please register or login to post a comment