You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cd go1.9/src/archive/tar
$ g tar:
common.go:205: return nil, errors.New("tar: FileInfo is nil")
common.go:232: return nil, fmt.Errorf("archive/tar: sockets not supported")
common.go:234: return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm)
reader.go:22: ErrHeader = errors.New("archive/tar: invalid tar header")
writer.go:23: ErrWriteTooLong = errors.New("archive/tar: write too long")
writer.go:24: ErrFieldTooLong = errors.New("archive/tar: header field too long")
writer.go:25: ErrWriteAfterClose = errors.New("archive/tar: write after close")
writer.go:26: errInvalidHeader = errors.New("archive/tar: header field too long or contains invalid values")
writer.go:51: tw.err = fmt.Errorf("archive/tar: missed writing %d bytes", tw.nb)
$
CL 55650 changed these, saying “Also, consistently use the "tar: " prefix for errors.” And sure enough:
$ cd ~/go/src/archive/tar
$ g tar:
common.go:31: ErrHeader = errors.New("tar: invalid tar header")
common.go:32: ErrWriteTooLong = errors.New("tar: write too long")
common.go:33: ErrFieldTooLong = errors.New("tar: header field too long")
common.go:34: ErrWriteAfterClose = errors.New("tar: write after close")
common.go:35: errMissData = errors.New("tar: sparse file references non-existent data")
common.go:36: errUnrefData = errors.New("tar: sparse file contains unreferenced data")
common.go:37: errWriteHole = errors.New("tar: write non-NUL byte in sparse hole")
common.go:43: const prefix = "tar: cannot encode header"
common.go:583: return errors.New("tar: invalid sparse holes")
common.go:701: return nil, errors.New("tar: FileInfo is nil")
common.go:728: return nil, fmt.Errorf("tar: sockets not supported")
common.go:730: return nil, fmt.Errorf("tar: unknown file mode %v", fm)
writer.go:56: return fmt.Errorf("tar: missed writing %d bytes", nb)
writer_test.go:272: // gnutar: Substituting `.' for empty member name
writer_test.go:274: // gnutar: Substituting `.' for empty member name
$
We know that changing error strings breaks client code (even if you think it shouldn't, we know it does). I understand wanting them to be consistent, but they were consistently archive/tar before - there was just one that didn't have the archive/ prefix. Why are we changing N-1 errors instead of 1 error?
CL 55650 changed these, saying “Also, consistently use the "tar: " prefix for errors.” And sure enough:
We know that changing error strings breaks client code (even if you think it shouldn't, we know it does). I understand wanting them to be consistent, but they were consistently archive/tar before - there was just one that didn't have the archive/ prefix. Why are we changing N-1 errors instead of 1 error?
/cc @dsnet
The text was updated successfully, but these errors were encountered: