Hi all, I followed a simple tutorial to gin and added go doc comments to all my functions, here is e.g.
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
// getAlbumByID locates the album whose ID value matches the id
// parameter sent by the client, then returns that album as a response.
// @Summary Get album by ID
// @Description get album by ID
// @Produce json
// @Param id path string true "Album ID"
// @Success 200 {object} album
// @Failure 404 {object} gin.H{"message": "album not found"}
// @Router /albums/{id} [get]
func getAlbumByID(c *gin.Context) {
// impl details...
}
However, when I run go doc .\cmd\gin it returns empty, and when I run godoc -http :8080 and navigate to my url of http://localhost:8080/pkg/toybox-go/cmd/gin/ it is also empty. This has been my experience for all my cmd folders so far. What's going on here?
my .mod file is in my toybox-go repo. I've been doing my best to follow best practices on this project, but not 100% sure if I'm doing things correctly as I'm a green gopher.
Here's my project tree setup:
C:.
├───.vscode
├───cmd
│ ├───client
│ ├───gin
│ └───server
├───githooks
├───node_modules
└───shared
├───models
└───utils