2015-11-19 12:11:17 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2016-07-02 06:20:02 +00:00
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"tarsum"
|
2015-11-19 12:11:17 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2016-07-02 06:21:20 +00:00
|
|
|
ts, err := tarsum.NewTarSum(os.Stdin, true, tarsum.Version1)
|
2016-07-02 06:20:02 +00:00
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2015-11-19 12:11:17 +00:00
|
|
|
|
2016-07-02 06:20:02 +00:00
|
|
|
if _, err = io.Copy(ioutil.Discard, ts); err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2015-11-19 12:11:17 +00:00
|
|
|
|
2016-07-02 06:20:02 +00:00
|
|
|
fmt.Println(ts.Sum(nil))
|
|
|
|
}
|