artefactual-sdps / enduro

A tool to support ingest and automation in digital preservation workflows
https://enduro.readthedocs.io/
Apache License 2.0
4 stars 3 forks source link

Return error for multiple config options set #854

Closed Diogenesoftoronto closed 7 months ago

Diogenesoftoronto commented 8 months ago

An error is now returned when a more than one storage configuration has been set. Previously, this would not return an error and simply use what -ever the user had set that was first in the storage switch options.

Closes #853

Diogenesoftoronto commented 8 months ago

I expected this to work because I expected Cstyle switch statements. I this works if I write the fall through keywords then we don't need to unMarshall a struct and allocate any extra memory here.

sevein commented 7 months ago

I this works if I write the fall through keywords then we don't need to unMarshall a struct and allocate any extra memory here.

I'd love to see what that looks like. Feel free to push a new commit with changes to UnmarshalJSON, ensuring the tests still pass.

sevein commented 7 months ago

Going to merge, feel free to submit an additional PR showing your alternative to UnmarshalJSON if you feel like it. I personally feel like this is easy to read and the overhead is definitely not substantial.