From a377d29cf7d8dcf283239de2159288a1c80cb81f Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 4 Mar 2020 09:52:45 -0500 Subject: [PATCH] *: include the original source and a go mod This is a silly thing from Jun 29 2016 just to view the TAR headers Signed-off-by: Vincent Batts --- go.mod | 3 +++ main.go | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 go.mod create mode 100644 main.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a98ae31 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.thisco.de/vbatts/tarinfo + +go 1.13 diff --git a/main.go b/main.go new file mode 100644 index 0000000..9622d0e --- /dev/null +++ b/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "archive/tar" + "fmt" + "log" + "os" +) + +func main() { + fh, err := os.Open(os.Args[1]) + if err != nil { + log.Fatal(err) + } + tr := tar.NewReader(fh) + for { + hdr, err := tr.Next() + if err != nil { + break + } + fmt.Printf("%#v\n", hdr) + } +}