package archive
import "cmd/internal/archive"
Package archive implements reading of archive files generated by the Go toolchain.
Index ¶
- Constants
- func FormatHeader(arhdr []byte, name string, size int64)
- func ReadHeader(b *bufio.Reader, name string) int
- type Archive
- func New(f *os.File) (*Archive, error)
- func Parse(f *os.File, verbose bool) (*Archive, error)
- func (a *Archive) AddEntry(typ EntryType, name string, mtime int64, uid, gid int, mode os.FileMode, size int64, r io.Reader)
- func (a *Archive) File() *os.File
- type Data
- type Entry
- type EntryType
- type ErrGoObjOtherVersion
- type GoObj
Constants ¶
const HeaderSize = 60
architecture-independent object file output
Functions ¶
func FormatHeader ¶
func ReadHeader ¶
Types ¶
type Archive ¶
type Archive struct { Entries []Entry // contains filtered or unexported fields }
func New ¶
New writes to f to make a new archive.
func Parse ¶
Parse parses an object file or archive from f.
func (*Archive) AddEntry ¶
func (a *Archive) AddEntry(typ EntryType, name string, mtime int64, uid, gid int, mode os.FileMode, size int64, r io.Reader)
AddEntry adds an entry to the end of a, with the content from r.
func (*Archive) File ¶
type Data ¶
A Data is a reference to data stored in an object file. It records the offset and size of the data, so that a client can read the data only if necessary.
type Entry ¶
type Entry struct { Name string Type EntryType Mtime int64 Uid int Gid int Mode os.FileMode Data Obj *GoObj // nil if this entry is not a Go object file }
func (*Entry) String ¶
type EntryType ¶
type EntryType int
type ErrGoObjOtherVersion ¶
type ErrGoObjOtherVersion struct {
// contains filtered or unexported fields
}
func (ErrGoObjOtherVersion) Error ¶
func (e ErrGoObjOtherVersion) Error() string
type GoObj ¶
Source Files ¶
- Version
- v1.24.0 (latest)
- Published
- Feb 10, 2025
- Platform
- linux/amd64
- Imports
- 13 packages
- Last checked
- 13 minutes ago –
Tools for package owners.