mirror of
https://github.com/adnanh/webhook.git
synced 2026-07-26 17:19:17 +08:00
Use the github.com/ghodss/yaml library to unserialize webhooks.
This supports both JSON and YAML seamlessly, providing for an easier human parseable format on disk.
This commit is contained in:
+3
-1
@@ -15,6 +15,8 @@ import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/ghodss/yaml"
|
||||
)
|
||||
|
||||
// Constants used to specify the parameter source
|
||||
@@ -503,7 +505,7 @@ func (h *Hooks) LoadFromFile(path string) error {
|
||||
return e
|
||||
}
|
||||
|
||||
e = json.Unmarshal(file, h)
|
||||
e = yaml.Unmarshal(file, h)
|
||||
return e
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user