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