make
call by omitting redundant arguments SCC-S1019144 ErrLimit: 100,
145 SpecStr: spec,
146 // we only store the pointer, so it won't use too many space
147 Errlist: make([]*taskerr, 100, 100),148 }
149
150 for _, opt := range opts {
The make
function has default values for the length and capacity arguments.
ch = make(chan int, 0)
sl = make([]int, 1, 1)
ch = make(chan int, 0)
sl = make([]int, 1, 1)
However, using named constants with channels is not considered an antipattern, for accommodating debugging, math, or platform-specific code.
const c = 0
ch = make(chan int, ch) // No issues raised