# Afero

> A filesystem abstraction for Go with in-memory and layered backends

Source: https://talira.ai/catalog/afero-3mv13e1y
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / filesystem](https://talira.ai/categories/libraries/filesystem), [languages / go](https://talira.ai/categories/languages/go)
- Licence: Apache-2.0[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Steve Francia](https://talira.ai/orgs/spf13.md)

Afero is a filesystem abstraction library for Go that mirrors the standard os package behind one afero.Fs interface, so code can run against the real disk, a concurrency-safe in-memory filesystem for tests, ZIP and TAR archives, or remote backends without changing. Filesystems compose: a copy-on-write layer for sandboxing, a read cache over a slow backend, a base-path jail, read-only and regex-filtered views, and an adapter for serving any of them over http.FileServer. It's compatible with Go's io/fs interfaces.

## Links

- GitHub: https://github.com/spf13/afero

## Problems it solves

- test Go code that reads and writes files without touching the disk
- swap the local filesystem for an in-memory one in tests
- restrict a Go program's file access to one directory

## Features

- an afero.Fs interface that mirrors the os package
- MemMapFs, a concurrency-safe in-memory filesystem for tests
- composable layers: copy-on-write, read cache, base-path jail, read-only and regex filters
- read-only ZIP and TAR archive filesystems
- compatible with Go's io/fs interfaces

## Limitations

- Its Google Cloud Storage and SFTP backends are marked experimental; S3 and other cloud backends come from third parties.[^1]

## Trust

Overall: 0.55 out of 1.
Signals: maintenance 0.62, adoption 0.77, momentum 0.51, community 0.80, backing 0.30, extensibility 0.00.

- last commit 38 days ago
- 26 commits in the last 90 days
- latest release v1.15.0 14 months ago
- 6.7k GitHub stars
- 100 contributors
- backed by Steve Francia

## Sources

[^1]: https://github.com/spf13/afero/blob/master/README.md (checked 28 Nov 2026)
[^2]: https://github.com/spf13/afero/blob/master/LICENSE.txt (checked 28 Nov 2026)
