本文整理汇总了Golang中go/skia/org/infra/go/tiling.Tile.Copy方法的典型用法代码示例。如果您正苦于以下问题:Golang Tile.Copy方法的具体用法?Golang Tile.Copy怎么用?Golang Tile.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go/skia/org/infra/go/tiling.Tile
的用法示例。
在下文中一共展示了Tile.Copy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TileWithTryData
// TileWithTryData will add all the trybot data for the given issue to the
// given Tile. A new Tile that is a copy of the original Tile will be returned,
// so we aren't modifying the underlying Tile.
func TileWithTryData(tile *tiling.Tile, issue string) (*tiling.Tile, error) {
ret := tile.Copy()
lastCommitIndex := tile.LastCommitIndex()
// The way we handle Tiles there is always empty space at the end of the
// Tile of index -1. Use that space to inject the trybot results.
ret.Commits[lastCommitIndex+1].CommitTime = time.Now().Unix()
lastCommitIndex = ret.LastCommitIndex()
tryResults, err := Get(issue)
if err != nil {
return nil, fmt.Errorf("AppendToTile: Failed to retreive trybot results: %s", err)
}
// Copy in the trybot data.
for k, v := range tryResults.Values {
if tr, ok := ret.Traces[k]; !ok {
continue
} else {
tr.(*types.PerfTrace).Values[lastCommitIndex] = v
}
}
return ret, nil
}