15 lines
212 B
Go
15 lines
212 B
Go
package server
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
func mustMarshalJson(in any) []byte {
|
|
out, err := json.Marshal(in)
|
|
if err != nil {
|
|
panic(fmt.Errorf("could not marshal %#v: %v", in, err))
|
|
}
|
|
return out
|
|
}
|