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

os/v2: fix inconsistent casing in names #1187

Open
niemeyer opened this issue Oct 10, 2010 · 12 comments
Open

os/v2: fix inconsistent casing in names #1187

niemeyer opened this issue Oct 10, 2010 · 12 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@niemeyer
Copy link
Contributor

Is there any sort of rule about the casing of functions used in the "os"
package?  Looking through, it doesn't sound like it's very easy to recall whether a
given function should be called LikeThat or Likethat.

For instance:

Mkdir
MkdirAll
TempDir
Getenv
ForkExec
Readlink
ReadAt
Readdir

It feels very ad-hoc, and hard to recall.
@peterGo
Copy link
Contributor

peterGo commented Oct 10, 2010

Comment 1:

It's easy to see what the casing rules are. Mkdir, Getenv, Readlink, and Readdir os
package names are all equivalent to corresponding Linux (and other Unix-style OSs)
lower-case function names with the first character capitalized so that the function
names are exported. MkdirAll, TempDir, ForkExec, and ReadAt have no corresponding OS
functions and use Go standard camel-case names with the first character capitalized so
that the function names are exported.

@niemeyer
Copy link
Contributor Author

Comment 2:

Not really (e.g. Readdirnames).
Then, even if that was the case, it'd be much better to have it internally consistent
than having a rule which includes knowing what another standard looks like.

@peterGo
Copy link
Contributor

peterGo commented Oct 10, 2010

Comment 3:

The Go Nuts mailing list is for Go language questions and discussions.
http://groups.google.com/group/golang-nuts
These has already been a discussion of these issues: FunctionName caseinconsistencies.
http://groups.google.com/group/golang-nuts/browse_thread/thread/dc52b51b4f007d50/

@niemeyer
Copy link
Contributor Author

Comment 4:

Yes, and the issue tracker is to report issues? Feels like both are being used the way
they should.  Also, the message from Russ which you point out seems to agree with the
problem I report:
"Names like Readdirnames, which are actual words, might be worth revisiting at some
point."
So, here is an issue to track this.

@rsc
Copy link
Contributor

rsc commented Oct 11, 2010

Comment 5:

Labels changed: added priority-low, removed priority-medium.

Status changed to LongTerm.

@rsc
Copy link
Contributor

rsc commented Dec 9, 2011

Comment 6:

Labels changed: added priority-someday, removed priority-low.

@gopherbot
Copy link

Comment 7 by elimisteve:

Agreed. 'strings.SplitN' and 'random.Intn' come to mind as well.

@gopherbot
Copy link

Comment 8 by elimisteve:

Agreed. And regarding consistency of casing in general, 'strings.SplitN' and
'random.Intn' come to mind as well.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 9:

Labels changed: added go2.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 10:

Labels changed: added repo-main.

@rsc
Copy link
Contributor

rsc commented Mar 3, 2014

Comment 11:

Adding Release=None to all Priority=Someday bugs.

Labels changed: added release-none.

@niemeyer niemeyer added longterm v2 A language change or incompatible library change labels Mar 3, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title os: inconsistent casing in names proposal: os: inconsistent casing in names Jun 17, 2017
@rsc rsc changed the title proposal: os: inconsistent casing in names proposal: os: fix inconsistent casing in names Jun 17, 2017
@ianlancetaylor ianlancetaylor added NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. and removed LongTerm labels Dec 5, 2017
@bankole7782
Copy link

I think this is manageable. It could lead to a lot of hard to do program rewrites.

@gopherbot gopherbot removed the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Aug 16, 2019
@gopherbot gopherbot added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Sep 3, 2019
@ianlancetaylor ianlancetaylor changed the title proposal: os: fix inconsistent casing in names os/v2: fix inconsistent casing in names Aug 23, 2023
@ianlancetaylor ianlancetaylor removed v2 A language change or incompatible library change NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Aug 23, 2023
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants