本文整理匯總了Golang中github.com/github/hub/github.Client.DeleteReleaseAsset方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.DeleteReleaseAsset方法的具體用法?Golang Client.DeleteReleaseAsset怎麽用?Golang Client.DeleteReleaseAsset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/github/hub/github.Client
的用法示例。
在下文中一共展示了Client.DeleteReleaseAsset方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: uploadAssets
func uploadAssets(gh *github.Client, release *github.Release, assets []string, args *Args) {
for _, asset := range assets {
var label string
parts := strings.SplitN(asset, "#", 2)
asset = parts[0]
if len(parts) > 1 {
label = parts[1]
}
if args.Noop {
if label == "" {
ui.Errorf("Would attach release asset `%s'\n", asset)
} else {
ui.Errorf("Would attach release asset `%s' with label `%s'\n", asset, label)
}
} else {
for _, existingAsset := range release.Assets {
if existingAsset.Name == filepath.Base(asset) {
err := gh.DeleteReleaseAsset(&existingAsset)
utils.Check(err)
break
}
}
ui.Errorf("Attaching release asset `%s'...\n", asset)
_, err := gh.UploadReleaseAsset(release, asset, label)
utils.Check(err)
}
}
}