Skip to content

internal: add PropFindValue#161

Merged
emersion merged 1 commit intomasterfrom
propfind-value
Jan 13, 2025
Merged

internal: add PropFindValue#161
emersion merged 1 commit intomasterfrom
propfind-value

Conversation

@emersion
Copy link
Owner

NewPropFindResponse uses callbacks to lazily build the response. However, some props are static: they don't require any processing to generate. Add a small helper to reduce boilerplate a bit.

NewPropFindResponse uses callbacks to lazily build the response.
However, some props are static: they don't require any processing
to generate. Add a small helper to reduce boilerplate a bit.
@emersion emersion requested a review from bitfehler April 17, 2024 15:54
Copy link

@oliverpool oliverpool left a comment

Choose a reason for hiding this comment

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

This change looks like a net improvement!

It would be nice to merge it, to prevent conflicts for future merge requests (I was almost ready to also make a fix for thunderbid, like #170 but with tests :)


type PropFindFunc func(raw *RawXMLValue) (interface{}, error)

func PropFindValue(value interface{}) PropFindFunc {

Choose a reason for hiding this comment

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

Would PropFindStatic be a name easier to grasp?

Suggested change
func PropFindValue(value interface{}) PropFindFunc {
func PropFindStatic(value interface{}) PropFindFunc {

@barkyq
Copy link

barkyq commented Jan 13, 2025

looks cleaner

@barkyq
Copy link

barkyq commented Jan 13, 2025

🎆

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