2015-11-19 12:11:17 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2016-07-02 07:20:02 +01:00
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
2018-03-26 17:47:31 +01:00
|
|
|
"github.com/docker/docker/pkg/tarsum"
|
2015-11-19 12:11:17 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2016-07-02 07:21:20 +01:00
|
|
|
ts, err := tarsum.NewTarSum(os.Stdin, true, tarsum.Version1)
|
2016-07-02 07:20:02 +01:00
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2015-11-19 12:11:17 +00:00
|
|
|
|
2016-07-02 07:20:02 +01: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 07:20:02 +01:00
|
|
|
fmt.Println(ts.Sum(nil))
|
|
|
|
}
|