Merge branch 'feat/complete-invocation-stub' of github.com:ucan-wg/go-ucan into feat/complete-invocation-stub

This commit is contained in:
Steve Moyer
2024-11-06 12:21:26 -05:00

View File

@@ -98,6 +98,9 @@ func (m *Meta) GetNode(key string) (ipld.Node, error) {
// Accepted types for the value are: bool, string, int, int32, int64, []byte,
// and ipld.Node.
func (m *Meta) Add(key string, val any) error {
if _, ok := m.Values[key]; ok {
return fmt.Errorf("duplicate key %q", key)
}
switch val := val.(type) {
case bool:
m.Values[key] = basicnode.NewBool(val)