4/3/2023 0 Comments Golang write fileA particular Reader or Writer might be an operating system file, a network connection, an in-memory buffer, a file in a ZIP archive, an HTTP response body, a file stored on a cloud server, or many other things. These have been widely implemented and used in the Go ecosystem. Go benefits from good abstractions for the data in a single file, such as the io.Reader, io.Writer, and related interfaces. Even when limited to abstracting disk blocks, file trees come in many forms: local operating-system files, files stored on other computers, files in memory, files in other files like ZIP archives. BackgroundĪ hierarchical tree of named files serves as a convenient, useful abstraction for a wide variety of resources, as demonstrated by Unix, Plan 9, and the HTTP REST idiom. This package is motivated in part by wanting to add support for embedded files to the go command. We also present changes to integrate the new package into the standard library. We present a possible design for a new Go standard library package io/fs that defines an interface for read-only file trees. See also the related embedded files draft design, which builds on this design. The prototype code is available for trying out. There is a video presentation of this draft design. For this change, we will use a Go Reddit thread to manage Q&A, since Reddit's threading support can easily match questions with answers and keep separate lines of discussion separate. We are using this change to experiment with new ways to scale discussions about large changes. The goal of circulating this draft design is to collect feedback to shape an intended eventual proposal. This is a Draft Design, not a formal Go proposal, because it describes a potential large change, with integration changes needed in multiple packages in the standard library as well potentially in third-party packages. File System Interfaces for Go - Draft Design
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |