You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm pretty new with golang, I wanted to progress and start some exercises from exercism.io!
the idea was to use the isLeap method from time pacakge, as far I understand function starting with low letter are not exported (public) and visible from other packages. Am I wrong?
In this huge repo, is there some rules to choose if a method should be exported or not?
What did you expect to see?
I'd like to avoid duplicate isLeap method as long Go SDK could provide it for me!
expected output
Hello, playground true
What did you see instead?
tmp/sandbox140448971/main.go:9: cannot refer to unexported name time.isLeap
tmp/sandbox140448971/main.go:9: undefined: time.isLeap
As I'm new here, I hope I haven't miss something evident! I guess this issue can be a bit controversial or subjective please close it if too many people speak (loose time) about it!
I through it's a good start to learn the contributing flow, so if some people are Ok with this proposal I would be please to follow the contributing Guide!
The text was updated successfully, but these errors were encountered:
ALTree
changed the title
Proposal to export time.isLeap func
proposal: time: export time.isLeap
Jul 7, 2017
There's a cost (maintenance, documentation, cognitive load from doc/API bloat) to exporting unnecessary or uncommon things.
The proposal process and gathering the data to justify why this should be exported and showing how many people would benefit will be more work than just doing the exercism exercise.
I doubt many people would need IsLeap.
You can just copy it (as @ALTree showed above). Even if you didn't know the leap year rules, you could use the time package to extract the information too:
And it's true I've probably used less than 10 times isLeap method on professional projects for at least 10 years in other languages. So we are letting that cost to projects that require isLeap function, I'm closing this issue!
What version of Go are you using (
go version
)?1.8.3
What operating system and processor architecture are you using (
go env
)?linux / amd64
What did you do?
https://play.golang.org/p/A3bUPA268d
I'm pretty new with golang, I wanted to progress and start some exercises from exercism.io!
the idea was to use the isLeap method from time pacakge, as far I understand function starting with low letter are not exported (public) and visible from other packages. Am I wrong?
In this huge repo, is there some rules to choose if a method should be exported or not?
What did you expect to see?
I'd like to avoid duplicate isLeap method as long Go SDK could provide it for me!
expected output
Hello, playground true
What did you see instead?
As I'm new here, I hope I haven't miss something evident! I guess this issue can be a bit controversial or subjective please close it if too many people speak (loose time) about it!
I through it's a good start to learn the contributing flow, so if some people are Ok with this proposal I would be please to follow the contributing Guide!
The text was updated successfully, but these errors were encountered: