2015-11-19 04:11:17 -08:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2016-07-01 23:20:02 -07:00
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
2018-03-26 09:47:31 -07:00
|
|
|
"github.com/docker/docker/pkg/tarsum"
|
2015-11-19 04:11:17 -08:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2016-07-01 23:21:20 -07:00
|
|
|
ts, err := tarsum.NewTarSum(os.Stdin, true, tarsum.Version1)
|
2016-07-01 23:20:02 -07:00
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2015-11-19 04:11:17 -08:00
|
|
|
|
2016-07-01 23:20:02 -07:00
|
|
|
if _, err = io.Copy(ioutil.Discard, ts); err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2015-11-19 04:11:17 -08:00
|
|
|
|
2016-07-01 23:20:02 -07:00
|
|
|
fmt.Println(ts.Sum(nil))
|
|
|
|
}
|