3 ms·
How about just using beloved tables instead? Maybe even with function literal to prepare some stuff, if you need to. for _, s := []string { p0[a:b],
by zzzcpan 12y ago
How about just using beloved tables instead? Maybe even with function literal to prepare some stuff, if you need to.
for _, s := []string {
p0[a:b],
p0[c:d],
// ...
} {
_, err = fd.Write(s)
if err != nil {
return err
}
}
As others already implied it could have been cleaner with exceptions, but I don't think this is that one case where exceptions are particularly important. There is no recursion yet or anything like that.