Skip to content

Commit 169a0b7

Browse files
committed
Export BuildID via expvars.
1 parent 921f161 commit 169a0b7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/shell.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"encoding/json"
2626
"encoding/pem"
2727
"errors"
28+
_ "expvar" // For DebugServer, below.
2829
"fmt"
2930
"io/ioutil"
3031
"log"

core/util.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"encoding/json"
2222
"encoding/pem"
2323
"errors"
24+
"expvar"
2425
"fmt"
2526
"hash"
2627
"io"
@@ -48,6 +49,11 @@ var BuildHost string
4849
// BuildTime is set by the compiler and is used by GetBuildTime
4950
var BuildTime string
5051

52+
func init() {
53+
expvar.NewString("BuildID").Set(BuildID)
54+
expvar.NewString("BuildTime").Set(BuildTime)
55+
}
56+
5157
// Errors
5258

5359
// InternalServerError indicates that something has gone wrong unrelated to the

0 commit comments

Comments
 (0)