Restructure refimpl into go-lang and python subdirectories

Move Go reference implementation to refimpl/go-lang/ and add new
Python reference implementation in refimpl/python/. Update build.sh
with renamed draft and simplified tool paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 23:11:55 +01:00
parent ff795c72e6
commit bbf557e54b
52 changed files with 3972 additions and 341 deletions

View File

@@ -0,0 +1,34 @@
package ect
import "encoding/json"
func marshalJSONString(s string) []byte {
b, _ := json.Marshal(s)
return b
}
func marshalJSONStringArray(a []string) []byte {
b, _ := json.Marshal(a)
return b
}
func unmarshalAudience(data []byte, a *Audience) error {
var raw json.RawMessage
if err := json.Unmarshal(data, &raw); err != nil {
return err
}
if len(raw) > 0 && raw[0] == '[' {
var arr []string
if err := json.Unmarshal(raw, &arr); err != nil {
return err
}
*a = arr
return nil
}
var s string
if err := json.Unmarshal(raw, &s); err != nil {
return err
}
*a = []string{s}
return nil
}