go-scm/internal/ax/jsonx/jsonx.go
Virgil c42cc4a6ce
Some checks failed
Security Scan / security (push) Failing after 10s
Test / test (push) Successful in 2m4s
chore(ax): gofmt exported declaration comments
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 05:44:09 +00:00

34 lines
751 B
Go

// SPDX-License-Identifier: EUPL-1.2
package jsonx
import (
"io"
json "github.com/goccy/go-json"
)
// Marshal mirrors encoding/json.Marshal.
func Marshal(v any) ([]byte, error) {
return json.Marshal(v)
}
// MarshalIndent mirrors encoding/json.MarshalIndent.
func MarshalIndent(v any, prefix, indent string) ([]byte, error) {
return json.MarshalIndent(v, prefix, indent)
}
// NewDecoder mirrors encoding/json.NewDecoder.
func NewDecoder(r io.Reader) *json.Decoder {
return json.NewDecoder(r)
}
// NewEncoder mirrors encoding/json.NewEncoder.
func NewEncoder(w io.Writer) *json.Encoder {
return json.NewEncoder(w)
}
// Unmarshal mirrors encoding/json.Unmarshal.
func Unmarshal(data []byte, v any) error {
return json.Unmarshal(data, v)
}