WIP: Custom unmarshal?

This commit is contained in:
IamTheFij 2022-01-27 19:57:06 -08:00
parent 6503b0a94c
commit 6d8fcee025

View File

@ -13,6 +13,21 @@ type Config struct {
Rules []BrowserRuleConfig
}
func (r *BrowserRule) UnmarshalJSON(data []byte) error {
var values struct {
command string
args []string
matchHostname []string
matchHostRegexp []string
matchRegexp []string
}
if err := json.Unmarshal(data, &values); err != nil {
return err
}
return nil
}
// BrowserRuleConfig represents a BrowserRule
type BrowserRuleConfig struct {
BrowserCommand []string