You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
345 B
25 lines
345 B
9 years ago
|
package main
|
||
|
|
||
|
import (
|
||
8 years ago
|
"fmt"
|
||
|
"io"
|
||
|
"io/ioutil"
|
||
|
"os"
|
||
6 years ago
|
"github.com/docker/docker/pkg/tarsum"
|
||
9 years ago
|
)
|
||
|
|
||
|
func main() {
|
||
8 years ago
|
ts, err := tarsum.NewTarSum(os.Stdin, true, tarsum.Version1)
|
||
8 years ago
|
if err != nil {
|
||
|
fmt.Println(err)
|
||
|
os.Exit(1)
|
||
|
}
|
||
9 years ago
|
|
||
8 years ago
|
if _, err = io.Copy(ioutil.Discard, ts); err != nil {
|
||
|
fmt.Println(err)
|
||
|
os.Exit(1)
|
||
|
}
|
||
9 years ago
|
|
||
8 years ago
|
fmt.Println(ts.Sum(nil))
|
||
|
}
|