Big refactor
This commit is contained in:
@@ -1 +0,0 @@
|
||||
package util
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package util
|
||||
|
||||
// H is a shortcut for creating a json-like object
|
||||
type H map[string]interface{}
|
||||
// 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 H) Apply(sources ...H) H {
|
||||
func (target Map) Apply(sources ...Map) Map {
|
||||
for _, source := range sources {
|
||||
for k, v := range source {
|
||||
target[k] = v
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"log"
|
||||
)
|
||||
|
||||
// GenerateRandomString generates a random base64 string from a random array of "n" bytes (to prevent padding let n be a multiple of 3)
|
||||
func GenerateRandomString(n int) string {
|
||||
b := make([]byte, n)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user