package resolve type Option func(*options) type options struct { strict bool acceptFirst bool } // AcceptFirstDigest keeps the first digest seen in the resolved map when two or // more digests are found for the same artifact during resolve's walk. func AcceptFirstDigest() Option { return func(o *options) { o.strict = false o.acceptFirst = true } } func makeOptions(opts ...Option) options { o := &options{} o.strict = true for _, opt := range opts { opt(o) } return *o }