Always include clear documentation for important code decisions and metadata. This includes preserving copyright notices and explaining the reasoning behind specific values and constants.
Always include clear documentation for important code decisions and metadata. This includes preserving copyright notices and explaining the reasoning behind specific values and constants.
For copyright notices:
For code constants and values:
Example:
// Original hard-coded value
svr.rc.VhostTcpMuxer, err = vhost.NewTcpHttpTunnelMuxer(l, 30*time.Second)
// Improved version with named constant and explanation
// DefaultTunnelTimeout defines how long to wait before closing inactive connections
// 30 seconds was chosen based on average connection usage patterns
const DefaultTunnelTimeout = 30 * time.Second
svr.rc.VhostTcpMuxer, err = vhost.NewTcpHttpTunnelMuxer(l, DefaultTunnelTimeout)
Enter the URL of a public GitHub repository