You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
website/util/objects.go

16 lines
335 B
Go

package util
// Map is a shortcut for creating a json-like object
type Map map[string]interface{}
// Apply is like Object.apply from JS and merges the given objects on top of target
func (target Map) Apply(sources ...Map) Map {
for _, source := range sources {
for k, v := range source {
target[k] = v
}
}
return target
}