Updated Vendoring

It resolves issues #474 and #589 which were coming from libcompose,
as well as resolves #440 and #437 partially as `group_add` & `stop_grace_period`
are supported by libcompose now.
This commit is contained in:
Suraj Narwade
2017-05-15 18:28:03 +05:30
parent 7ddce35dd5
commit 7f00fec328
78 changed files with 1454 additions and 1772 deletions
+9
View File
@@ -237,6 +237,11 @@ func newError(err ResultError, context *jsonContext, value interface{}, locale l
err.SetValue(value)
err.SetDetails(details)
details["field"] = err.Field()
if _, exists := details["context"]; !exists && context != nil {
details["context"] = context.String()
}
err.SetDescription(formatErrorDescription(d, details))
}
@@ -257,6 +262,10 @@ func formatErrorDescription(s string, details ErrorDetails) string {
errorTemplates.Lock()
tpl = errorTemplates.New(s)
if ErrorTemplateFuncs != nil {
tpl.Funcs(ErrorTemplateFuncs)
}
tpl, err = tpl.Parse(s)
errorTemplates.Unlock()
+4
View File
@@ -31,6 +31,7 @@ import (
"errors"
"reflect"
"regexp"
"text/template"
"github.com/xeipuuv/gojsonreference"
)
@@ -39,6 +40,9 @@ var (
// Locale is the default locale to use
// Library users can overwrite with their own implementation
Locale locale = DefaultLocale{}
// ErrorTemplateFuncs allows you to define custom template funcs for use in localization.
ErrorTemplateFuncs template.FuncMap
)
func NewSchema(l JSONLoader) (*Schema, error) {