-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Hoping to get some opinions on this.
One pattern I see a lot is with making global constants for values that are only used within a certain function.
For example
const _defaultPort = 8000
func something() {
doSomething(_defaultPort)
port := _defaultPort
}In my opinion, there should be an adjustment to the # Reduce Scope of Variables section to include more emphasis on what to do with Constants.
I mostly want to get opinions here, but I generally would prefer to change the above code to the following:
func something() {
const defaultPort = 8000
doSomething(defaultPort)
port := defaultPort
}Thoughts?
alxn
Metadata
Metadata
Assignees
Labels
No labels