This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jsonconvert | |
import "encoding/json" | |
func Deserialize[T any](str string) (T, error) { | |
var d T | |
err := json.Unmarshal([]byte(str), &d) | |
if err != nil { | |
return d, err | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package customTypes | |
import ( | |
"errors" | |
"fmt" | |
"strings" | |
"time" | |
) | |
type JSONTime time.Time |