1
0

udpate readme

This commit is contained in:
Arpad Ryszka 2026-01-21 22:09:19 +01:00
parent 20bb6895bf
commit fa0ea2e997

View File

@ -1,6 +1,14 @@
# Docreflect # Docreflect
Library and command to help accessing go doc comments during runtime. Library and tooling to help accessing go doc comments during runtime.
The docreflect library provides functions to access the Go doc based documentation of Go runtime objects, like
types, functions and methods, struct fields, or packages, during runtime, using their reflection handle to look
up the right snippet.
To be able to do that, the documentation needs to be captured during build time.
**Generating GoDoc registry code:**
Go doc comments are not accessible during runtime via reflection. To make them avaiable during runtime, we need Go doc comments are not accessible during runtime via reflection. To make them avaiable during runtime, we need
to capture them during build time. The docreflect command, or the docreflect/generate library package, fetches to capture them during build time. The docreflect command, or the docreflect/generate library package, fetches
@ -24,7 +32,7 @@ level docreflect package methods.
Library documentation: https://godocs.io/code.squareroundforest.org/arpio/docreflect Library documentation: https://godocs.io/code.squareroundforest.org/arpio/docreflect
To insall the docreflect command, run: To install the docreflect command, run:
``` ```
make install make install
@ -33,9 +41,10 @@ make install
Usage of the docreflect command: Usage of the docreflect command:
``` ```
docreflect generate \ docreflect \
--package-name mypackage \ mypackage \
coderepos.org/jdoe/mypackage coderepos.org/jdoe/otherpackage \ coderepos.org/jdoe/mypackage \
coderepos.org/jdoe/otherpackage \
> docreflect.go > docreflect.go
``` ```