Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option ,inline needs a struct value field #55

Open
rjeczalik opened this issue Nov 17, 2014 · 1 comment · May be fixed by #792
Open

Option ,inline needs a struct value field #55

rjeczalik opened this issue Nov 17, 2014 · 1 comment · May be fixed by #792

Comments

@rjeczalik
Copy link

Is there any reason against inlining member being pointer to a struct, complementary to a struct value?

No issue with extending the switch here?

@niemeyer
Copy link
Contributor

No big reason other than implementation convenience. It means all fields are already in memory rather than having to consider the nil case and initialize it appropriately.

It's a wart we should eventually fix.

rjeczalik added a commit to rjeczalik/koding that referenced this issue Sep 18, 2016
The Inliner supports merging two objects into
single one during JSON or BSON encoding/decoding.

The merge is needed in order to store Credential
and Bootstrap information as single object for
Sneaker storage. The current Sneaker / Mongo
implementation assumes they're merged into
single object.

Currently JSON does not support inlining:

  golang/go#6213

And BSON inlining does not work for out use-case:

  go-yaml/yaml#55

Thus this helper struct for inlining two values
into one.

The values are assumed to be objects - map[string]interface{}.
rjeczalik added a commit to rjeczalik/koding that referenced this issue Sep 18, 2016
The Inliner supports merging two objects into
single one during JSON or BSON encoding/decoding.

The merge is needed in order to store Credential
and Bootstrap information as single object for
Sneaker storage. The current Sneaker / Mongo
implementation assumes they're merged into
single object.

Currently JSON does not support inlining:

  golang/go#6213

And BSON inlining does not work for out use-case:

  go-yaml/yaml#55

Thus this helper struct for inlining two values
into one.

The values are assumed to be objects - map[string]interface{}.
rjeczalik added a commit to rjeczalik/koding that referenced this issue Sep 19, 2016
The Inliner supports merging two objects into
single one during JSON or BSON encoding/decoding.

The merge is needed in order to store Credential
and Bootstrap information as a single object for
Sneaker storage. The current Sneaker / Mongo
implementation assumes they're merged into
single object.

Currently JSON does not support inlining:

  golang/go#6213

And BSON inlining does not work for our use-case:

  go-yaml/yaml#55

Thus this helper struct for inlining two values
into one.

The values are assumed to be objects - map[string]interface{}.
stevenh added a commit to stevenh/yaml that referenced this issue Oct 11, 2021
Add support for inline struct pointers for exported fields.

Also:
* Cleanup errors using fmt.Errorf instead of string concatenating.
* Removed commented out code.
* Formatted edited files with goimports.

Fixes go-yaml#55
@stevenh stevenh linked a pull request Oct 11, 2021 that will close this issue
corpix added a commit to corpix/revip that referenced this issue Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants