当前位置:网站首页>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)
}
边栏推荐
- Summary of six points of MySQL optimization
- FCN: Fully Convolutional Networks for Semantic Segmentation
- You can have both fish and bear's paw! Sky wing cloud elastic bare metal is attractive!
- 2022最新Android面试笔试,一个安卓程序员的面试心得
- Thoroughly understand why network i/o is blocked?
- AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
- 5. 数据访问 - EntityFramework集成
- Is it safe to open an account and register stocks for stock speculation? Is there any risk? Is it reliable?
- What is text mining? "Suggested collection"
- 使用文件和目录属性和属性
猜你喜欢
为什么 BI 软件都搞不定关联分析?带你分析分析
Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
[HCIA cloud] [1] definition of cloud computing, what is cloud computing, architecture and technical description of cloud computing, Huawei cloud computing products, and description of Huawei memory DD
How to write good code defensive programming
怎么自动安装pythn三方库
一朵云开启智慧交通新未来
2022最新Android面试笔试,一个安卓程序员的面试心得
2022 Alibaba Android advanced interview questions sharing, 2022 Alibaba hand Taobao Android interview questions
Word finds red text word finds color font word finds highlighted formatted text
The 11th China cloud computing standards and Applications Conference | China cloud data has become the deputy leader unit of the cloud migration special group of the cloud computing standards working
随机推荐
You can have both fish and bear's paw! Sky wing cloud elastic bare metal is attractive!
U-Net: Convolutional Networks for Biomedical Images Segmentation
lombok @Builder注解
Oracle 中文排序 Oracle 中文字段排序
Linear table - abstract data type
Oracle Chinese sorting Oracle Chinese field sorting
Startup and shutdown of CDB instances
Optimization of middle alignment of loading style of device player in easycvr electronic map
Video fusion cloud platform easycvr adds multi-level grouping, which can flexibly manage access devices
The monthly list of Tencent cloud developer community videos was released in May 2022
All you want to know about clothing ERP is here
ROS安装报错 sudo: rosdep:找不到命令
【历史上的今天】7 月 5 日:Google 之母出生;同一天诞生的两位图灵奖先驱
2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目
跨境支付平台 XTransfer 的低代码实践:如何与其他中台融合是核心
Chinese postman? Really powerful!
websocket 工具的使用
2022最新中高级Android面试题目,【原理+实战+视频+源码】
Reading notes of Clickhouse principle analysis and Application Practice (5)
MYSQL中 find_in_set() 函数用法详解