| // Copyright 2019 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| package buildbucket |
| |
| import ( |
| buildbucketpb "go.chromium.org/luci/buildbucket/proto" |
| ) |
| |
| // Build is a helper for reading Buildbucket Build information. |
| type Build buildbucketpb.Build |
| |
| // OutputProperty returns the output property with the given name. Returns (nil, false) |
| // if not found. |
| func (b Build) OutputProperty(name string) (*Property, bool) { |
| prop, ok := b.Output.Properties.Fields[name] |
| if !ok { |
| return nil, false |
| } |
| return &Property{name: name, value: prop}, true |
| } |