Is there a difference, mainly in performance, between constants defined inside vs outside a function scope?
func (this *Person) SetDefaults() *Person{
const (
defaultFirstName = "first"
defaultLastName = "last"
)
//do stuff with constants
return this
}
vs.
const (
defaultFirstName = "first"
defaultLastName = "last"
)
func (this *Person) SetDefaults() *Person{
//do stuff with constants
return this
}