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

refactor(model): simplify using ArchivalBinaryData #1323

Merged
merged 1 commit into from
Sep 28, 2023
Merged

Conversation

bassosimone
Copy link
Contributor

It did not originally occur to me, but now it's clear that we can avoid using a struct to wrap the data type.

It just suffices to use the new type.

I think this is better in terms of writing code because the only two things we need to do are:

  1. make sure we have serialization and unserialization tests;

  2. use the correct data type in the struct.

For all intents and purposes the ArchivalBinaryData is just a special kind of []byte attached to custom marshal/unmarshal rules.

Part of ooni/probe#2531

It did not originally occur to me, but now it's clear that we can
avoid using a struct to wrap the data type.

It just suffices to use the new type.

I think this is better in terms of writing code because the only
two things we need to do are:

1. make sure we have serialization and unserialization tests;

2. use the correct data type in the struct.

For all intents and purposes the ArchivalBinaryData is just a special
kind of []byte attached to custom marshal/unmarshal rules.

Part of ooni/probe#2531
@bassosimone bassosimone merged commit 3fb3d32 into master Sep 28, 2023
8 checks passed
@bassosimone bassosimone deleted the issue/2531 branch September 28, 2023 12:16
Murphy-OrangeMud pushed a commit to Murphy-OrangeMud/probe-cli that referenced this pull request Feb 13, 2024
It did not originally occur to me, but now it's clear that we can avoid
using a struct to wrap the data type.

It just suffices to use the new type.

I think this is better in terms of writing code because the only two
things we need to do are:

1. make sure we have serialization and unserialization tests;

2. use the correct data type in the struct.

For all intents and purposes the ArchivalBinaryData is just a special
kind of []byte attached to custom marshal/unmarshal rules.

Part of ooni/probe#2531
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.

1 participant