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

Suggestion: Rename AddData and AddDatas for clarity #3251

Closed
ksw2000 opened this issue Dec 17, 2024 · 3 comments · Fixed by #3255
Closed

Suggestion: Rename AddData and AddDatas for clarity #3251

ksw2000 opened this issue Dec 17, 2024 · 3 comments · Fixed by #3255

Comments

@ksw2000
Copy link
Contributor

ksw2000 commented Dec 17, 2024

I suggest renaming AddData to AddItem and AddDatas to AddItems. The word "data" is already plural, so datas is not a standard word in English. Adding an -s is grammatically incorrect.

The word data comes from Latin, where:

  • Datum is the singular form, meaning "a given fact" or "a single piece of information."
  • Data is the plural form, referring to multiple facts or pieces of information.

so AddDatas is redundant and may cause confusion. AddItem and AddItems would be clearer and more consistent with common naming conventions.

In client/request.go

  • func (r *Request) AddFormDatafunc (r *Request) AddFormItem
  • func (r *Request) AddFormDatasfunc (r *Request) AddFormItems
  • func (r *Request) SetFormDatafunc (r *Request) SetFormItem
  • func (r *Request) SetFormDatasfunc (r *Request) SetFormItems
  • func (r *Request) SetFormDatasWithStructfunc (r *Request) SetFormItemsWithStruct
  • func (r *Request) DelFormDatasfunc (r *Request) DelFormItems
  • func (f *FormData) AddDatasfunc (f *FormData) AddItems
  • func (f *FormData) SetDatasfunc (f *FormData) SetItems
  • func (f *FormData) SetDatasWithStructfunc (f *FormData) SetItemsWithStruct
  • func (f *FormData) DelDatasfunc (f *FormData) DelItems

In PR #3255, it was decided to make the following changes:

  • func (r *Request) AddFormData → Not changed
  • func (r *Request) AddFormDatasfunc (r *Request) AddFormDataWithMap
  • func (r *Request) SetFormData → Not changed
  • func (r *Request) SetFormDatasfunc (r *Request) SetFormDataWithMap
  • func (r *Request) SetFormDatasWithStructfunc (r *Request) SetFormDataWithStruct (remove s)
  • func (r *Request) DelFormDatasfunc (r *Request) DelFormData (remove s)
  • func (f *FormData) AddDatafunc (f *FormData) Add (keep consistent with fasthttp.Args)
  • func (f *FormData) SetDatafunc (f *FormData) Set (keep consistent with fasthttp.Args)
  • func (f *FormData) AddDatasfunc (f *FormData) AddWithMap
  • func (f *FormData) SetDatasfunc (f *FormData) SetWithMap
  • func (f *FormData) SetDatasWithStructfunc (f *FormData) SetWithStruct
  • func (f *FormData) DelDatasfunc (f *FormData) DelData (remove s)
@gaby
Copy link
Member

gaby commented Dec 17, 2024

@ksw2000 This was already in the to-do list. We had discussed it and forgot to change it during the merge request.

@gaby gaby self-assigned this Dec 17, 2024
@ksw2000
Copy link
Contributor Author

ksw2000 commented Dec 18, 2024

@gaby Can I create a pull request to rename these functions?

@ReneWerner87
Copy link
Member

Yeah its ok

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