From the course: Programming with Go Modules

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Documenting module packages

Documenting module packages - Go Tutorial

From the course: Programming with Go Modules

Documenting module packages

[Instructor] Module packages, especially libraries are designed to be shared and reused by other developers. Because of that, it is important to properly document your module packages. Documentation helps developers, including your future self, to communicate to others the intent, behavior, and usage of your module. Fortunately, in Go, source code documentation is regarded as a first-class feature. Code documentation is embedded directly in the source files as comments, and Go tools can automatically extract documentation from the comment text. In this video, we're going to go over code documentation for our package, and later in the course it'll become clear why you should properly document your module packages. So now we're back in our IDE, and the first thing we're going to do is add a package-wide documentation. So we're going to do that by creating a new file called doc.go. So by convention, when you use a file called doc.go you can use it to document the package itself, which is…

Contents