0

I want to write some document for my program and use godoc to generate a html document page.

However, it reveals some exported constants and variables. They are exportable because other packages in this program need them. But it is unnecessary for a user to acknowledge these constants and variables. And showing them in document is ugly.

So can I hide constants and variables part in godoc page for my personal packages?

kun uran
  • 19
  • 1
  • 2
    You can't. If they are exported, anyone can access them. Consider using `internal` packages if they're not meant for the outside world. – icza Aug 13 '21 at 10:52

1 Answers1

0

So can I hide constants and variables part in godoc page for my personal packages?

No.

Volker
  • 40,468
  • 7
  • 81
  • 87