Use SkipOutput instead of -1 for output indexes to clarify semantics.

Signed-off-by: Ben Longo <benlongo9807@gmail.com>
This commit is contained in:
Ben Longo
2022-12-16 23:01:13 -05:00
parent 6b004d3536
commit 97a45ef6a4
2 changed files with 2 additions and 2 deletions

View File

@@ -339,7 +339,7 @@ func (e *ExecOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
inputIndex = pb.Empty
}
outputIndex := pb.OutputIndex(-1)
outputIndex := pb.SkipOutput
if !m.noOutput && !m.readonly && m.cacheID == "" && !m.tmpfs {
outputIndex = pb.OutputIndex(outIndex)
outIndex++

View File

@@ -702,7 +702,7 @@ func (f *FileOp) Marshal(ctx context.Context, c *Constraints) (digest.Digest, []
pop.Inputs = state.inputs
for i, st := range state.actions {
output := pb.OutputIndex(-1)
output := pb.SkipOutput
if i+1 == len(state.actions) {
output = 0
}