goap/utils.go
2024-07-29 13:26:31 +02:00

21 lines
479 B
Go

package goap
import (
"time"
"gitlab.com/mstarongitlab/goutils/other"
)
func appendWithKey(toAppend map[string]any, key string, val any) map[string]any {
toAppend[key] = val
return toAppend
}
// Returns an array of values since that's what expected for compression later on
func timeToXmlTime(t time.Time) []ValueValue[string] {
return []ValueValue[string]{
{
Type: other.IntoPointer(KEY_XMLSCHEMA_DATETIME),
Value: t.Format("2006-01-02T15:04:05.000Z"),
}}
}