Skip to content

Instantly share code, notes, and snippets.

@johnsonz
johnsonz / go-rar-uncompress-cmd
Created May 17, 2016 08:22
go使用winrar解压rar文件
func uncompress(dir string) {
err := filepath.Walk(dir, func(path string, file os.FileInfo, err error) error {
if file == nil {
return nil
}
if file.IsDir() {
return nil
}
ext := filepath.Ext(path)
if ext == ".rar" {
@johnsonz
johnsonz / go-zip-uncompress-native
Created May 17, 2016 08:20
go使用archive/zip原生包解压zip文件
package main
import (
"archive/zip"
"fmt"
"io"
"os"
)
func main() {
@johnsonz
johnsonz / go-zip-uncompress-cmd
Created May 17, 2016 08:18
go使用7z解压zip文件
func uncompress(dir string) {
err := filepath.Walk(dir, func(path string, file os.FileInfo, err error) error {
if file == nil {
return nil
}
if file.IsDir() {
return nil
}
ext := filepath.Ext(path)
if ext == ".zip" {