Hint when author concats different types into a string
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 167
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the problem/challenge you have**
```
Message: unable to stamp object for resource [source-scanner] in supply chain [source-test-scan-to-url]: unable to apply ytt template: ytt: Error:
- unknown binary op: string + int
in
stdin.yml:6 | name: #@ data.values.workload.metadata.name + "-" + i
```
**Describe the solution you'd like**
```diff
Message: unable to stamp object for resource [source-scanner] in supply chain [source-test-scan-to-url]: unable to apply ytt template: ytt: Error:
- unknown binary op: string + int
in
stdin.yml:6 | name: #@ data.values.workload.metadata.name + "-" + i
+ (hint: to concatenate non-string values in a string, use str() or string.format())
```
**Anything else you would like to add:**
Source: https://kubernetes.slack.com/archives/CH8KCCKA5
A continuation of: #509
---
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
Contributor guide
Research direction
Reproduce the string-plus-integer failure shown at stdin.yml:6 and trace where ytt formats the “unknown binary op” error. Done means this case includes the requested str() or string.format() hint while preserving the existing error location and message context.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100