{"repo":"spf13/afero","free":true,"listed":false,"github":"https://github.com/spf13/afero","clone":"git clone https://github.com/spf13/afero.git","description":"The Universal Filesystem Abstraction for Go","language":"Go","stars":6688,"topics":["compression","filesystem","fs","go","golang","network-file-system","network-file-transfer","vfs","virtual"],"license":"Apache-2.0","category":"dev-tools","readme_excerpt":"Afero: The Universal Filesystem Abstraction for Go Afero is a filesystem abstraction library for Go that works as a drop-in replacement for the standard os package. Adopt it with minimal code changes, then swap any backend—local disk, in-memory, cloud, or archive—without touching your application logic. Two headline benefits: testing becomes trivial (replace the OS with a fast in-memory filesystem in one line, no disk cleanup required), and your code stays portable across any storage backend through a single afero.Fs interface. Why Afero? Afero elevates filesystem interaction beyond simple file reading and writing, offering solutions for testability, flexibility, and advanced architecture. 🔑 Key Features: Universal API: Write your code once. Run it against the local OS, in-memory storage, ZIP/TAR archives, or remote systems (SFTP, GCS). Ultimate Testability: Utilize MemMapFs , a fully concurrent-safe, read/write in-memory filesystem. Write fast, isolated, and reliable unit tests without touching the physical disk or worrying about cleanup. Powerful Composition: Afero's hidden superpower. Layer filesystems on top of each other to create sophisticated behaviors: Sandboxing: Use CopyOnWriteFs to create temporary scratch spaces that isolate changes from the base filesystem. Caching: Use CacheOnReadFs to automatically layer a fast cache (like memory) over a slow backend (like a network drive). Security Jails: Use BasePathFs to restrict application access to a specific subdirector","default_branch":null,"files":null,"tree":[],"storefront":"/r/spf13","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spf13/afero/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}