MCPcopy Create free account
hub / github.com/containers/image / goDiffIDComputationGoroutineWithTimeout

Function goDiffIDComputationGoroutineWithTimeout

copy/single_test.go:100–110  ·  view source on GitHub ↗
(layerStream io.ReadCloser, decompressor compressiontypes.DecompressorFunc)

Source from the content-addressed store, hash-verified

98}
99
100func goDiffIDComputationGoroutineWithTimeout(layerStream io.ReadCloser, decompressor compressiontypes.DecompressorFunc) *diffIDResult {
101 ch := make(chan diffIDResult)
102 go diffIDComputationGoroutine(ch, layerStream, decompressor)
103 timeout := time.After(time.Second)
104 select {
105 case res := <-ch:
106 return &res
107 case <-timeout:
108 return nil
109 }
110}
111
112func TestDiffIDComputationGoroutine(t *testing.T) {
113 stream, err := os.Open("fixtures/Hello.uncompressed")

Callers 1

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…