_, err = fd.Write(p0[a:b])
if err != nil {
return err
}
_, err = fd.Write(p1[c:d])
if err != nil {
return err
}
_, err = fd.Write(p2[e:f])
if err != nil {
return err
}
// and so on
func (ew *errWriter) write(buf []byte) {
if ew.err != nil {
return
}
_, ew.err = ew.w.Write(buf)
}
w := &errWriter{w: fd}
ew.write(p0[a:b])
ew.write(p1[c:d])
ew.write(p2[e:f])
// and so on
if ew.err != nil {
return ew.err
}
Dim a As Integer
If CheckState() Then
a = 12
Else
a = 13
End If
a = IIf(CheckState(), 12, 13)
a = IIf(CheckState(), GetTrueAValue(), GetFalseAValue())
w := &errWriter{w: fd}
ew.write(getAB())
ew.write(getCD())
ew.write(getEF())
// and so on
if ew.err != nil {
return ew.err
}
_, err = fd.Write(getAB())
if err != nil {
return err
}
_, err = fd.Write(getCD())
if err != nil {
return err
}
_, err = fd.Write(getEF())
if err != nil {
return err
}
On Error Resume Next
Source: https://habr.com/ru/post/271167/
All Articles