diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-04 19:50:11 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-08 11:51:47 +1100 |
commit | 99a8b1ae8bb93565df8acbe168749278dc768979 (patch) | |
tree | 06f3707ff08a879cf9fac550cf71f42bbe0215bf /pkg/utils | |
parent | ccc771d8b13d5b0d4635db4463556366470fd4f6 (diff) |
making a start on unidirectional data binding to fix these UI bugs
Diffstat (limited to 'pkg/utils')
-rw-r--r-- | pkg/utils/utils.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index e2a5337e3..390f85f70 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -1,6 +1,7 @@ package utils import ( + "encoding/json" "errors" "fmt" "log" @@ -235,3 +236,8 @@ func PrevIndex(numbers []int, currentNumber int) int { } return end } + +func AsJson(i interface{}) string { + bytes, _ := json.MarshalIndent(i, "", " ") + return string(bytes) +} |