#Godoc comments and public interfaces

7 messages · Page 1 of 1 (latest)

hollow shore
#

HI there, I am working on an Open Source issue and came across an issue in the golang language that I am a beginner in. I am tasked me to comment on public interfaces, what exactly are public interfaces and which files are applicable to it? For reference this is the repo: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/pkg/ottl

GitHub

Contrib repository for the OpenTelemetry Collector - open-telemetry/opentelemetry-collector-contrib

uneven bronze
#

I didn't look where it's written but my guess is that they mean interfaces which are public(exported), aka can be accessed through other packages when importing.
In Go something is exported if it starts with an uppercase letter

#

So I'm guessing they want you to add comments on interfaces that are exported.

#

If you don't know about interfaces there's a page on the Go Tour about them

hollow shore
#

this is what they said in the issue: [pkg/ottl] Add godoc comments to everything #28893: We should add godoc comments to all public interfaces in all the ottl packages

uneven bronze
#

Then you need to add comments to the exported interfaces