Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bpicolo
49 days ago
|
parent
|
context
|
favorite
| on:
Go subtleties
For 1/, you can return a struct value type without exporting it. If it satisfies the receiving interface they won’t have a problem.
That’s exactly the pattern I use for most Go development
kbolino
49 days ago
[–]
This affects discoverability, though. Your unexported type won't have public documentation. So you end up having to publish an interface anyway (even if you don't return it) or document in words what the method set looks like.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
That’s exactly the pattern I use for most Go development