Skip to content

Add header debug info #1

@micahyoung

Description

@micahyoung

POC

package main

import (
        "archive/tar"
        "fmt"
        "io"
        "log"
        "os"
)

func main() {

        file, err := os.Open(os.Args[1])
        if err != nil {
                os.Exit(1)
        }

        // Open and iterate through the files in the archive.
        tr := tar.NewReader(file)
        for {
                hdr, err := tr.Next()
                if err == io.EOF {
                        break // End of archive
                }
                if err != nil {
                        log.Fatal(err)
                }
                fmt.Printf("Found %s:\n", hdr.Name)
                fmt.Printf("Header %#+v:\n", hdr)
        }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions