From fa0ea2e9975c9a4c027b5957eb3f4a3898997a25 Mon Sep 17 00:00:00 2001 From: Arpad Ryszka Date: Wed, 21 Jan 2026 22:09:19 +0100 Subject: [PATCH] udpate readme --- readme.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index e9d3e46..f4274cd 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,14 @@ # 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 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 -To insall the docreflect command, run: +To install the docreflect command, run: ``` make install @@ -33,9 +41,10 @@ make install Usage of the docreflect command: ``` -docreflect generate \ - --package-name mypackage \ - coderepos.org/jdoe/mypackage coderepos.org/jdoe/otherpackage \ +docreflect \ + mypackage \ + coderepos.org/jdoe/mypackage \ + coderepos.org/jdoe/otherpackage \ > docreflect.go ```