mirror of
https://github.com/kovetskiy/mark.git
synced 2025-05-25 14:32:40 +08:00
28 lines
388 B
Go
28 lines
388 B
Go
package fs
|
|
|
|
import (
|
|
"archive/tar"
|
|
"io"
|
|
|
|
"github.com/reconquest/karma-go"
|
|
)
|
|
|
|
type TarFileSystem struct {
|
|
files map[string][]byte
|
|
}
|
|
|
|
func NewTarFileSystem(input io.Reader) (*TarFileSystem, error) {
|
|
files := map[string][]byte{}
|
|
|
|
archive := tar.NewReader(input)
|
|
for {
|
|
header, err := archive.Next()
|
|
if err != nil {
|
|
return nil, karma.Format(
|
|
err,
|
|
"asdasd",
|
|
)
|
|
}
|
|
}
|
|
}
|