arlo-go/internal/util/util.go

26 lines
519 B
Go
Raw Normal View History

2017-12-09 03:55:38 +00:00
package util
import (
"encoding/json"
"fmt"
)
func PrettyPrint(data interface{}) string {
j, err := json.MarshalIndent(data, "", " ")
if err != nil {
return fmt.Sprint("error:", err)
}
return fmt.Sprint(string(j))
}
2017-12-10 19:17:09 +00:00
const TransIdPrefix = "web"
2017-12-09 03:55:38 +00:00
2017-12-10 19:17:09 +00:00
func GenTransId(transType string) {
/*
func divmod(numerator, denominator int64) (quotient, remainder int64) {
quotient = numerator / denominator // integer division, decimals are truncated
remainder = numerator % denominator
return
}*/
2017-12-09 03:55:38 +00:00
}