当前位置:网站首页>Golang through pointer for Range implements the change of the value of the element in the slice
Golang through pointer for Range implements the change of the value of the element in the slice
2022-07-05 18:54:00 【Learn programming notes】
*(&build.Args[2])=destination
*(&build.Args[6])=cacherepo
// Resolve when editing again ,workflow template The problem of not getting updates .
// Latest solutions : adopt argo workflow Global parameter mechanism to solve
builds := argoflowObject.Spec.Templates.Build
for _, build := range builds {
repoUrl:=build.BuildFormData.RepoUrl
if strings.Contains(repoUrl,"https://"){
repoUrl=strings.ReplaceAll(build.BuildFormData.RepoUrl,"https://","")
}
if strings.Contains(repoUrl,"http://"){
repoUrl=strings.ReplaceAll(build.BuildFormData.RepoUrl,"http://","")
}
finalImageName:=repoUrl+"/"+build.BuildFormData.ImageName+":"+build.BuildFormData.ImageTag
destination := build.Args[2]
cacherepo := build.Args[6]
destination=strings.Split(destination,"=")[0]+"="+finalImageName
cacherepo=strings.Split(cacherepo,"=")[0]+"="+repoUrl+"/"+build.BuildFormData.ImageName
*(&build.Args[2])=destination
*(&build.Args[6])=cacherepo
fmt.Println("build.Args:",build.Args)
}
边栏推荐
- RedHat7.4配置yum软件仓库(RHEL7.4)
- Use QT to traverse JSON documents and search sub objects
- Solutions contents have differences only in line separators
- 7-1 链表也简单fina
- 快速生成ipa包
- Lombok @builder annotation
- The era of Web3.0 is coming. See how Tianyi cloud storage resources revitalize the system to enable new infrastructure (Part 2)
- What is text mining? "Suggested collection"
- Ant group open source trusted privacy computing framework "argot": open and universal
- Word查找红色文字 Word查找颜色字体 Word查找突出格式文本
猜你喜欢

MySQL数据库索引教程(超详细)

Mysql database indexing tutorial (super detailed)

AI Open2022|基于异质信息网络的推荐系统综述:概念,方法,应用与资源

The era of Web3.0 is coming. See how Tianyi cloud storage resources revitalize the system to enable new infrastructure (Part 2)

Windows Oracle 开启远程连接 Windows Server Oracle 开启远程连接

2022全网最全的腾讯后台自动化测试与持续部署实践【万字长文】

从外卖点单浅谈伪需求

How much does the mlperf list weigh when AI is named?

中文版Postman?功能真心强大!

5. Data access - entityframework integration
随机推荐
Is it safe for Apple mobile phone to speculate in stocks? Is it a fraud to get new debts?
瞅一瞅JUC提供的限流工具Semaphore
XML basic knowledge concept
技术分享 | 接口测试价值与体系
一文读懂简单查询代价估算
Is it safe to make fund fixed investment on access letter?
一朵云开启智慧交通新未来
LeetCode 6109. 知道秘密的人数
Solutions contents have differences only in line separators
Is the performance evaluation of suppliers in the fastener industry cumbersome? Choose the right tool to easily counter attack!
XML基础知识概念
Pytorch yolov5 training custom data
You can have both fish and bear's paw! Sky wing cloud elastic bare metal is attractive!
Oracle Chinese sorting Oracle Chinese field sorting
Overview of video self supervised learning
The easycvr authorization expiration page cannot be logged in. How to solve it?
Is it safe to open an account, register and dig money? Is there any risk? Is it reliable?
7-2 保持链表有序
The monthly list of Tencent cloud developer community videos was released in May 2022
跨境支付平台 XTransfer 的低代码实践:如何与其他中台融合是核心