MCPcopy
hub / github.com/hashicorp/go-getter / testMD5

Function testMD5

decompress_testing.go:156–171  ·  view source on GitHub ↗
(t testing.T, path string)

Source from the content-addressed store, hash-verified

154}
155
156func testMD5(t testing.T, path string) string {
157 f, err := os.Open(path)
158 if err != nil {
159 t.Fatalf("err: %s", err)
160 }
161 defer f.Close()
162
163 h := md5.New()
164 _, err = io.Copy(h, f)
165 if err != nil {
166 t.Fatalf("err: %s", err)
167 }
168
169 result := h.Sum(nil)
170 return hex.EncodeToString(result)
171}

Callers 2

TestDecompressorFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by 2

TestDecompressorFunction · 0.68