This is one of the idioms of Go I liked. "It's OK to repeat the same 3 lines of code."
My thought process has always been: If there is a common piece of functionality to be shared, then refactor. If it just happens to be the same, maybe leave it.
My thought process has always been: If there is a common piece of functionality to be shared, then refactor. If it just happens to be the same, maybe leave it.
… 2–3 times. Not ok to repeat them 1000 times.