Skip to content

Conversation

@zhangyongding
Copy link
Contributor

No description provided.

@zhangyongding zhangyongding requested a review from a team as a code owner October 30, 2025 08:42
@ldesauw
Copy link
Contributor

ldesauw commented Nov 6, 2025

Is the issue with Encode/Decode something you encountered only on this type of payload ?
If this is a more general issue it may need to be fixed in the encode/decode or to fix the way to improve payload.
Looking into it

@zhangyongding
Copy link
Contributor Author

Yes, only on this type of payload

@zhangyongding
Copy link
Contributor Author

Can it be merged

return err
}

if d.Tag() == kmip.TagReplaceExisting {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion, you can use d.Opt(kmip.TagReplaceExisting, &pl.ReplaceExisting) to reduce the boilerplate

func (dec *Decoder) Opt(tag int, value any) error {
	if dec.Tag() == tag {
		return dec.TagAny(tag, value)
	}
	return nil
}

}
}
}
return nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it return an error instead if the object-type cannot be found in the attribute list ?

@phsym
Copy link
Collaborator

phsym commented Dec 12, 2025

Hi @zhangyongding thanks for submitting this change. I made few comments, but looks good overall.

Sorry for the delays in reviewing this

return err
}

for i := range pl.Attribute {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you do not need to lookup the object type in the attribute list as the type is encoded in the tag of the object struct itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants