MCPcopy Create free account
hub / github.com/compozy/agh / decodeRawString

Function decodeRawString

internal/api/core/agent_channels.go:673–683  ·  view source on GitHub ↗
(raw json.RawMessage, target *string)

Source from the content-addressed store, hash-verified

671}
672
673func decodeRawString(raw json.RawMessage, target *string) error {
674 if len(bytes.TrimSpace(raw)) == 0 || bytes.Equal(bytes.TrimSpace(raw), []byte("null")) {
675 return nil
676 }
677 var value string
678 if err := json.Unmarshal(raw, &value); err != nil {
679 return err
680 }
681 *target = strings.TrimSpace(value)
682 return nil
683}
684
685func validateAgentChannelRequest(
686 body json.RawMessage,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected