当前位置:网站首页>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)
}
边栏推荐
- 集合处理的利器
- Ant group open source trusted privacy computing framework "argot": open and universal
- Startup and shutdown of CDB instances
- Memory leak of viewpager + recyclerview
- How to automatically install pythn third-party libraries
- Share: ZTE Yuanhang 30 Pro root unlock BL magick ZTE 7532n 8040n 9041n brush mask original brush package root method Download
- 5. Data access - entityframework integration
- ROS installation error sudo: rosdep: command not found
- The road of enterprise digital transformation starts from here
- The easycvr authorization expiration page cannot be logged in. How to solve it?
猜你喜欢
随机推荐
《ClickHouse原理解析与应用实践》读书笔记(5)
使用文件和目录属性和属性
ROS installation error sudo: rosdep: command not found
How much does the mlperf list weigh when AI is named?
Rse2020/ cloud detection: accurate cloud detection of high-resolution remote sensing images based on weak supervision and deep learning
Common time complexity
Shang Silicon Valley Shang preferred project tutorial release
The 2022 China Xinchuang Ecological Market Research and model selection evaluation report released that Huayun data was selected as the mainstream manufacturer of Xinchuang IT infrastructure!
爬虫01-爬虫基本原理讲解
Oracle 中文排序 Oracle 中文字段排序
蚂蚁集团开源可信隐私计算框架「隐语」:开放、通用
Tupu software digital twin smart wind power system
Deep copy and shallow copy [interview question 3]
Is it safe to open an account, register and dig money? Is there any risk? Is it reliable?
案例分享|金融业数据运营运维一体化建设
c期末复习
Word finds red text word finds color font word finds highlighted formatted text
XML基础知识概念
What is text mining? "Suggested collection"
Startup and shutdown of CDB instances









