当前位置:网站首页>golang通过指针for...range实现切片中元素的值的更改
golang通过指针for...range实现切片中元素的值的更改
2022-07-05 18:36:00 【学亮编程手记】
*(&build.Args[2])=destination
*(&build.Args[6])=cacherepo
//解决再次编辑时,workflow template得不到更新的问题。
//最新解决方案:通过argo workflow的全局参数机制来解决
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)
}
边栏推荐
- Trust counts the number of occurrences of words in the file
- Share: ZTE Yuanhang 30 Pro root unlock BL magick ZTE 7532n 8040n 9041n brush mask original brush package root method Download
- Is the performance evaluation of suppliers in the fastener industry cumbersome? Choose the right tool to easily counter attack!
- Memory leak of viewpager + recyclerview
- 2022 Alibaba Android advanced interview questions sharing, 2022 Alibaba hand Taobao Android interview questions
- Use QT to traverse JSON documents and search sub objects
- Exemple Quelle est la relation entre le taux d'échantillonnage, l'échantillon et la durée?
- Problems encountered in the project u-parse component rendering problems
- LeetCode 6109. 知道秘密的人数
- EasyCVR授权到期页面无法登录,该如何解决?
猜你喜欢
The road of enterprise digital transformation starts from here
5. 数据访问 - EntityFramework集成
进程间通信(IPC):共享内存
中文版Postman?功能真心强大!
Isprs2020/ cloud detection: transferring deep learning models for cloud detection between landsat-8 and proba-v
Overview of video self supervised learning
The worse the AI performance, the higher the bonus? Doctor of New York University offered a reward for the task of making the big model perform poorly
LeetCode 6111. 螺旋矩阵 IV
Memory leak of viewpager + recyclerview
Ant group open source trusted privacy computing framework "argot": open and universal
随机推荐
About Estimation with Cross-Validation
什么是文本挖掘 ?「建议收藏」
2022 latest Android interview written examination, an Android programmer's interview experience
Thoroughly understand why network i/o is blocked?
Vulnhub's darkhole_ two
面试官:Redis 过期删除策略和内存淘汰策略有什么区别?
音视频包的pts,dts,duration的由来.
Pytorch yolov5 training custom data
Is it safe to open an account, register and dig money? Is there any risk? Is it reliable?
Emqx 5.0 officially released: a single cluster supports 100million mqtt connections
Lombok @builder annotation
sample_rate(采样率),sample(采样),duration(时长)是什么关系
Is the performance evaluation of suppliers in the fastener industry cumbersome? Choose the right tool to easily counter attack!
Windows Oracle 开启远程连接 Windows Server Oracle 开启远程连接
Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
常见时间复杂度
在通达信上做基金定投安全吗?
Use file and directory properties and properties
Reptile 01 basic principles of reptile
Find in MySQL_ in_ Detailed explanation of set() function usage