envsubst -no-unset blows up on ${FOO:=}
- Ngôn ngữ chính
- Go
- Star
- 907
- Fork
- 96
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
It seems that an empty default value is treated as if a default value has not been provided.
Expected:
```console
~ $ go install github.com/a8m/envsubst/cmd/envsubst@v1.4.2
~ $ go/bin/envsubst -no-unset <<< 'value: ${FOO:=}'
value:
~ $ echo $?
0
~ $
```
Got:
```console
~ $ go install github.com/a8m/envsubst/cmd/envsubst@v1.4.2
~ $ go/bin/envsubst -no-unset <<< 'value: ${FOO:=}'
variable ${FOO} not set
~ $ echo $?
1
~ $
```
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Look at the parsing logic for variable substitution in the source code, likely in a file like parse.go or subst.go. The bug is that ${FOO:=} with an empty default is incorrectly flagged as unset when -no-unset is used. Run the existing tests to see how defaults are handled, then add a test case for this scenario and fix the parsing to treat empty defaults as valid.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- go, shell
- Lĩnh vực
- cli, tooling
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 65/100