Repository navigation
Storage v0.13.0
Storage operations now take a context.Context as their first argument. Reuse a disk across requests and pass each request's deadline or cancellation directly to the operation.
body, err := disk.Get(ctx, "uploads/report.pdf")Upgrading
- Use
storage.Build(ctx, cfg),storage.New(ctx, cfg), anddriver.New(ctx, cfg)for setup. Usedisk.Get(ctx, path)in place ofdisk.WithContext(ctx).Get(path). The same convention applies to writes, file counts, and paginated listings. - Rename streaming calls to
OpenObject,PutObject, andWalkObjects. Uses3storage.PrepareBucket(ctx, cfg)to explicitly provision an S3 bucket. - Update custom drivers and test doubles to accept context and implement
Close() error. Close standalone disks withdisk.Close()and manager-owned disks withmanager.Close().
Upgrade the root package and the drivers you use together. For example, upgrade Storage and the local driver with Go 1.25 or newer.
go get github.com/goforj/storage github.com/goforj/storage/driver/localstorageThe root package, storagecore, storagetest, and all 14 drivers have their own module tags. The root requires Go 1.24.4. Driver and test helper minimums remain unchanged.