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