blob: d667533b2deef7e31940a1f00f30501b4ec1a7cf [file] [log] [blame]
package topics
import (
"fmt"
"github.com/bazelbuild/rules_go/go/tools/bazel"
"os"
)
func Read(topic string) string {
rpath := "docs/help/topics/" + topic
r, err := bazel.Runfile(rpath)
if err != nil {
fmt.Fprintf(os.Stderr, "Unable to locate %s in runfiles: %v\n", rpath, err)
}
c, err := os.ReadFile(r)
if err != nil {
fmt.Fprintf(os.Stderr, "Failed to read %s: %v\n", r, err)
}
return string(c)
}