MCPcopy Create free account
hub / github.com/couchbase/moss / AddRef

Method AddRef

file.go:74–85  ·  view source on GitHub ↗

AddRef increases the ref-count on the file ref.

()

Source from the content-addressed store, hash-verified

72
73// AddRef increases the ref-count on the file ref.
74func (r *FileRef) AddRef() File {
75 if r == nil {
76 return nil
77 }
78
79 r.m.Lock()
80 r.refs++
81 file := r.file
82 r.m.Unlock()
83
84 return file
85}
86
87// DecRef decreases the ref-count on the file ref, and closing the
88// underlying file when the ref-count reaches zero.

Callers 1

TestFileRefFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestFileRefFunction · 0.76