DEV Community

Discussion on: Constants in Go.

Collapse
 
vinaypai profile image
Vinay Pai

I'm sure you're aware of this, but for completeness for the first section, constants CAN be declared using expressions that can be evaluated at compile time.


const SECONDS_IN_HOUR = 3600
const HOURS_IN_DAY = 60

const SECONDS_IN_DAY = SECONDS_IN_HOUR * HOURS_IN_DAY

Collapse
 
codehakase profile image
Francis Sunday

Thanks Vinay for pointing this out.