mirror of
https://github.com/lukaszraczylo/harness-sync.git
synced 2026-10-13 00:48:30 +00:00
feat(adapter): registry with detect filtering and duplicate guard
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
// Package render holds deterministic format marshallers.
|
||||
package render
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
func JSON(v any) ([]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
enc := json.NewEncoder(&buf)
|
||||
enc.SetIndent("", " ")
|
||||
enc.SetEscapeHTML(false)
|
||||
if err := enc.Encode(v); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
Reference in New Issue
Block a user