• Kirill Smelkov's avatar
    xerr += First, Merge · 79e328c5
    Kirill Smelkov authored
    This are handy utilities to reduce several errors into only 1 either
    picking the first error or merging, if there are several, into Errorv.
    
    It is unfortunate but an issue with Errorv was realized that even though
    it satisfies the error interface, it cannot be generally worked with as
    error because it (being []error) is uncomparable. Thus e.g. the following
    code, if err dynamic type is Errorv, will panic:
    
    	if err == io.EOF
    
    It is pity Go slices are uncomparable.
    79e328c5
xerr_test.go 3.48 KB