strings.Replace(taskFileContents, "))", "END_VAR", -1)
72 // contain unresolved variables in "task.yml":((task_content)), we will pre-process task
73 // contents and temporarily replace "((" with "START_VAR" and "))" with "END_VAR"
74 taskFileContents = strings.Replace(taskFileContents, "((", "START_VAR", -1)
75 taskFileContents = strings.Replace(taskFileContents, "))", "END_VAR", -1) 76
77 // then when we run the pipeline itself, it will contain an additional step called 'process-task-definition'
78 // to do a backwards conversion to "((" and "))" using taskUnwrapContents
strings.Replace(taskFileContents, "((", "START_VAR", -1)
71 // since we are using create_files() in mock resource and we don't want pipeline resource to
72 // contain unresolved variables in "task.yml":((task_content)), we will pre-process task
73 // contents and temporarily replace "((" with "START_VAR" and "))" with "END_VAR"
74 taskFileContents = strings.Replace(taskFileContents, "((", "START_VAR", -1) 75 taskFileContents = strings.Replace(taskFileContents, "))", "END_VAR", -1)
76
77 // then when we run the pipeline itself, it will contain an additional step called 'process-task-definition'
strings.Replace(strings.ToLower(env), "_", "-", -1)
196}
197
198func flagify(env string) string {
199 return strings.Replace(strings.ToLower(env), "_", "-", -1)200}
201
202func getGdnFlagsFromConfig(configPath string) (GdnBinaryFlags, error) {
strings.Replace(typedNode, fmt.Sprintf("((%s))", name), foundValStr, -1)
113 switch foundVal.(type) {
114 case string, int, int16, int32, int64, uint, uint16, uint32, uint64, json.Number:
115 foundValStr := fmt.Sprintf("%v", foundVal)
116 typedNode = strings.Replace(typedNode, fmt.Sprintf("((%s))", name), foundValStr, -1)117 default:
118 return nil, InvalidInterpolationError{
119 Name: name,
strings.Replace(strings.Join(lines, ","), " ", "", -1)
101func presentMap(version interface{}) string {
102 marshalled, _ := yaml.Marshal(version)
103 lines := strings.Split(strings.TrimSpace(string(marshalled)), "\n")
104 return strings.Replace(strings.Join(lines, ","), " ", "", -1)105}
106
107func presentResourceType(resourceType *atc.VolumeResourceType) string {
Certain functions, for a particular set of arguments, have shorthands (helpers) that can be used instead.
We currently support Autofix for, Format: x => y where "x" is recommended to be replaced with "y" helper function.
Supported Autofix for the following: strings.SplitN(s, ".", -1) => strings.Split(s, ".") strings.Map(unicode.ToTitle, s) => strings.ToTitle(s) strings.Replace(s, "a", "b", -1) => strings.ReplaceAll(s, "a", "b") bytes.SplitN(b, []byte("."), -1) => bytes.Split(b, []byte(".")) bytes.Map(unicode.ToUpper, b) => bytes.ToUpper(b) bytes.Map(unicode.ToLower, b) => bytes.ToLower(b) bytes.Map(unicode.ToTitle, b) => bytes.ToTitle(b) bytes.Replace(b, b, b, -1) => bytes.ReplaceAll(b, b, b) http.HandlerFunc(http.NotFound) => http.NotFoundHandler() draw.DrawMask(i, r, i, p, nil, image.Point{}, o) => draw.Draw(i, r, i, p, o)
wg.Add(1)
// some code
wg.Add(-1)
wg.Add(1)
// some code
wg.Done()
strings.SplitN(str, splitChar, -1)
strings.Split(str, splitChar)
http.HandlerFunc("/non-existent", http404)
http.NotFoundHandler("/non-existent")