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

[Optional Upgrade] Remove Duplicate Prefixes In The Field Names #47

Closed
RishabhBhatnagar opened this issue Nov 13, 2020 · 5 comments
Closed

Comments

@RishabhBhatnagar
Copy link
Collaborator

Some of the structs in the tools-golang spdx data model has members that repeat the name of the struct in their name.
The member of such structs should be refactored to remove the name of the struct they are contained in.

For example,
Package struct have fields like PackageName, PackageVersion, etc.
Fields of Package struct can be renamed to Name, Version, etc.

@swinslow
Copy link
Member

+1, this is a good idea. The struct fields have the names they currently do because I was closely mirroring the tag-value field names. But it would be shorter and simpler to use without having to repeat the prefix over and over.

@epicadk
Copy link

epicadk commented Nov 27, 2020

Hey , Can I work on this?

@swinslow
Copy link
Member

Hi @epicadk, certainly, you're welcome to try this out if you would like!

Note that in addition to renaming the members within the various structs in the spdx package, you'll then need to also make conforming changes to the other packages in the golang tools that use those structs.

Feel free to ask me or @RishabhBhatnagar if you have any questions. @RishabhBhatnagar, feel free to weigh in also if you have thoughts here (or if you've already started on this).

@RishabhBhatnagar
Copy link
Collaborator Author

@epicadk, thanks for taking this issue.
If you haven't seen it already, you can refer to the UML and spdx-spec for more details on the naming. It would be better if the data model stays as close to the documentation as possible.

epicadk added a commit to epicadk/tools-golang that referenced this issue Nov 30, 2020
epicadk added a commit to epicadk/tools-golang that referenced this issue Dec 28, 2020
epicadk added a commit to epicadk/tools-golang that referenced this issue Dec 29, 2020
Signed-off-by: epicadk <adityakurkure@gmail.com>
@swinslow
Copy link
Member

swinslow commented Jul 4, 2021

As mentioned at #57 (comment), I'm going to close this issue for now, as the existing field names are getting used by users of the project. As the tools-golang community grows, we can re-evaluate and reconsider in the future if appropriate.

@swinslow swinslow closed this as completed Jul 4, 2021
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 a pull request may close this issue.

3 participants