{"id":26826719,"url":"https://github.com/hslam/tar","last_synced_at":"2026-05-03T05:32:25.737Z","repository":{"id":57559640,"uuid":"324944150","full_name":"hslam/tar","owner":"hslam","description":"Package tar implements access to tar archives.","archived":false,"fork":false,"pushed_at":"2021-03-09T12:06:50.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-30T22:39:04.907Z","etag":null,"topics":["archive","go","golang","gz","gzip","tar","targz"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hslam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-28T07:36:20.000Z","updated_at":"2021-04-11T14:20:56.000Z","dependencies_parsed_at":"2022-08-28T14:02:42.688Z","dependency_job_id":null,"html_url":"https://github.com/hslam/tar","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hslam/tar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslam%2Ftar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslam%2Ftar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslam%2Ftar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslam%2Ftar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hslam","download_url":"https://codeload.github.com/hslam/tar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hslam%2Ftar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32559714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T03:21:47.309Z","status":"ssl_error","status_checked_at":"2026-05-03T03:21:43.884Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archive","go","golang","gz","gzip","tar","targz"],"created_at":"2025-03-30T11:30:44.296Z","updated_at":"2026-05-03T05:32:25.721Z","avatar_url":"https://github.com/hslam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tar\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/hslam/tar)](https://pkg.go.dev/github.com/hslam/tar)\n[![Build Status](https://github.com/hslam/tar/workflows/build/badge.svg)](https://github.com/hslam/tar/actions)\n[![codecov](https://codecov.io/gh/hslam/tar/branch/master/graph/badge.svg)](https://codecov.io/gh/hslam/tar)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hslam/tar)](https://goreportcard.com/report/github.com/hslam/tar)\n[![LICENSE](https://img.shields.io/github/license/hslam/tar.svg?style=flat-square)](https://github.com/hslam/tar/blob/master/LICENSE)\n\nPackage tar implements access to tar archives.\n\n## Feature\n* Tar\n* Gzip\n* Tar files or dirs\n\n## Get started\n\n### Install\n```\ngo get github.com/hslam/tar\n```\n### Import\n```\nimport \"github.com/hslam/tar\"\n```\n### Usage\n#### Example\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/hslam/tar\"\n\t\"os\"\n)\n\nfunc main() {\n\tname := \"file\"\n\ttargz := \"file.tar.gz\"\n\tdefer os.Remove(name)\n\tdefer os.Remove(targz)\n\tfile, err := os.Create(name)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcontents := \"Hello World\"\n\tfile.Write([]byte(contents))\n\tfile.Close()\n\ttar.Targz(targz, name)\n\tos.Remove(name)\n\ttar.Untargz(targz)\n\tf, err := os.Open(name)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer f.Close()\n\tbuf := make([]byte, len(contents))\n\tf.Read(buf)\n\tfmt.Println(string(buf))\n}\n```\n\n#### Tar bytes example\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/hslam/tar\"\n\t\"os\"\n)\n\nfunc main() {\n\ttargz := \"file.tar.gz\"\n\tdefer os.Remove(targz)\n\ttw, err := tar.NewGzipFileWriter(targz)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\ttw.TarBytes(\"file\", []byte(\"Hello World\"))\n\ttw.Flush()\n\ttw.Close()\n\ttr, err := tar.NewGzipFileReader(targz)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t_, _, data, err := tr.NextBytes()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(string(data))\n}\n```\n\n#### Output\n```\nHello World\n```\n\n### License\nThis package is licensed under a MIT license (Copyright (c) 2020 Meng Huang)\n\n### Author\ntar was written by Meng Huang.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhslam%2Ftar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhslam%2Ftar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhslam%2Ftar/lists"}