@@ -27,6 +27,11 @@ import (
2727 "syscall"
2828)
2929
30+ /* This is for Go Releaser.
31+ * https://github.com/goreleaser/goreleaser#a-note-about-mainversion
32+ */
33+ var version = "master"
34+
3035//
3136// Configuration structure, designed for gcfg
3237//
@@ -114,9 +119,10 @@ type Ctx struct {
114119// JSON server information response
115120//
116121type Info struct {
122+ Version string `json:"clammit_version"`
117123 Address string `json:"scan_server_url"`
118124 PingResult string `json:"ping_result"`
119- Version string `json:"version "`
125+ ScannerVersion string `json:"scan_server_version "`
120126 TestScanVirusResult string `json:"test_scan_virus"`
121127 TestScanCleanResult string `json:"test_scan_clean"`
122128}
@@ -354,16 +360,17 @@ func infoHandler(w http.ResponseWriter, req *http.Request) {
354360
355361 info := & Info {
356362 Address : ctx .Scanner .Address (),
363+ Version : version ,
357364 }
358365 if err := ctx .Scanner .Ping (); err != nil {
359366 info .PingResult = err .Error ()
360367 } else {
361368 info .PingResult = "Connected to server OK"
362369 if response , err := ctx .Scanner .Version (); err != nil {
363- info .Version = err .Error ()
370+ info .ScannerVersion = err .Error ()
364371 } else {
365372 for s := range response {
366- info .Version += s
373+ info .ScannerVersion += s
367374 }
368375 }
369376 /*
0 commit comments