当前位置:网站首页>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)
}
边栏推荐
猜你喜欢
小程序 修改样式 ( placeholder、checkbox的样式)
如何快速进阶自动化测试?听听这3位BAT大厂测试工程师的切身感想....
LeetCode 6109. Number of people who know the secret
How much does the mlperf list weigh when AI is named?
面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
Pytorch yolov5 training custom data
【HCIA-cloud】【1】云计算的定义、什么是云计算、云计算的架构与技术说明、华为云计算产品、华为内存DDR配置工具说明
中文版Postman?功能真心强大!
Word查找红色文字 Word查找颜色字体 Word查找突出格式文本
Reptile 01 basic principles of reptile
随机推荐
XML基础知识概念
彻底理解为什么网络 I/O 会被阻塞?
Trust counts the number of occurrences of words in the file
深入底层C源码讲透Redis核心设计原理
@Extension, @spi annotation principle
sample_rate(采样率),sample(采样),duration(时长)是什么关系
Is it safe to make fund fixed investment on access letter?
Interprocess communication (IPC): shared memory
sample_ What is the relationship between rate, sample and duration
websocket 工具的使用
Use QT to traverse JSON documents and search sub objects
U-Net: Convolutional Networks for Biomedical Images Segmentation
Web3.0时代来了,看天翼云存储资源盘活系统如何赋能新基建(下)
Deep copy and shallow copy [interview question 3]
为什么 BI 软件都搞不定关联分析?带你分析分析
Postman核心功能解析 —— 参数化和测试报告
进程间通信(IPC):共享内存
RPC protocol details
集合处理的利器
瞅一瞅JUC提供的限流工具Semaphore