G-Node / gin-doi

G-Node DOI Service
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

[util.go] 'FunderName' vs 'Funder': Potential name mixup #81

Open mpsonntag opened 3 years ago

mpsonntag commented 3 years ago

The util.go function FunderName is linked via the template.Func map, but seems to be unused.

There is a reference in template.go to funding.Funder which cannot be found in the code. Since funding.Funder appears right next to funding.AwardNumber and there is an AwardNumber function in util.go right next to the FunderName function, funding.Funder should probably be funding.FunderName in template.go.

achilleas-k commented 3 years ago

The util.go function FunderName is linked via the template.Func map, but seems to be unused.

It's an old function for formatting the funding information in templates but isn't used anymore. Can be safely deleted.

There is a reference in template.go to funding.Funder which cannot be found in the code.

funding in the info template: https://github.com/G-Node/gin-doi/blob/a276b7e69f45c60ee22a65291eb682dd6f3647e4/templates/info.go#L50-L52 is an instance of FundingReference which is defined in libgin: https://github.com/G-Node/libgin/blob/7cddc5bb2c86ea49da5bec0df4a3a40f4896d40e/libgin/datacite.go#L94-L98

Since funding.Funder appears right next to funding.AwardNumber and there is an AwardNumber function in util.go right next to the FunderName function, funding.Funder should probably be funding.FunderName in template.go.

AwardNumber is also a field of the FundingReference. The AwardNumber() function, like the Funder() function is also old and unused and should probably be deleted.

The Funder string could be renamed to FunderName in libgin for clarity. It would probably be better since the field name in the XML is actually funderName as well.