SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
package iceberg
import (
"errors"
"strings"
"testing"
)
func TestGuardReadTurnsAPanicIntoAnError(t *testing.T) {
v, err := guardRead("data/x.parquet", func() (int, error) {
var s []int
return s[3], nil // index out of range
})
if v != 0 || err == nil || !strings.Contains(err.Error(), "data/x.parquet") || !strings.Contains(err.Error(), "panic") {
t.Fatalf("v = %d, err = %v: want a zero value and an error naming the file", v, err)
}
want := errors.New("plain error")
if _, err := guardRead("data/y.parquet", func() (int, error) { return 0, want }); err != want {
t.Fatalf("err = %v, want the function's own error unchanged", err)
}
}