Reputation: 20539
Is it possible to get package comment from inside of Go program? The equivalent Python code:
#!/usr/bin/env python
"""
Program v1.0
"""
print(__doc__)
Upvotes: 2
Views: 690
Reputation: 93082
Go is not an interpreted language. The source code representation of a program is not part of a compiled Go program and cannot be generated from a compiled Go program. What you want is not possible without external tools that embed the parts of the source you want into the binary.
Upvotes: 1