1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 09:57:01 +00:00

new minor features

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-04-09 14:51:34 +03:00
parent f17a325df6
commit 4dfd4c53d3
14 changed files with 455 additions and 41 deletions

View File

@@ -19,6 +19,7 @@ import (
"path/filepath"
"reflect"
"regexp"
"runtime/debug"
"sort"
"strconv"
"strings"
@@ -45,6 +46,31 @@ import (
"gopkg.in/yaml.v3"
)
var (
// BuildRevision holds the vcs commit id information.
BuildRevision string
// BuildTime holds the vcs commit time information.
BuildTime string
)
func init() {
if info, ok := debug.ReadBuildInfo(); ok {
for _, setting := range info.Settings {
if BuildRevision != "" && BuildTime != "" {
break
}
if setting.Key == "vcs.revision" {
BuildRevision = setting.Value
}
if setting.Key == "vcs.time" {
BuildTime = setting.Key
}
}
}
}
type (
// BodyDecoder is an interface which any struct can implement in order to customize the decode action
// from ReadJSON and ReadXML