File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -64,15 +64,37 @@ jobs:
64
64
<(sed -E 's/^go([0-9]+)[.]([0-9]+)([.]([0-9]+))?(([a-z]+)([0-9]+))?/\1.\2\n\4\n\6\n\7/i' \
65
65
<(curl -fsSL "https://go.dev/dl/?mode=json&include=all" | jq -rc .[0].version) \
66
66
)
67
-
67
+ echo "${norm[0]}"
68
+ echo "${norm[1]}"
69
+ echo "${norm[2]}"
70
+ echo "${norm[3]}"
68
71
# Serialize version, making sure we have a patch version, and separate possible rcX into .rc-X
69
72
[ "${norm[1]}" != "" ] || norm[1]="0"
70
73
norm[1]=".${norm[1]}"
71
74
[ "${norm[2]}" == "" ] || norm[2]="-${norm[2]}"
72
- [ "${norm[3]}" == "" ] || norm[3]=".${norm[3]}"
75
+ if [ -n "${norm[3]}" ]; then
76
+ echo "norm3 meet"
77
+ length=${#norm[3]}
78
+ echo "Character length $length"
79
+ for ((i = 0; i < length; i++)); do
80
+ char="${norm[3]:i:1}"
81
+ echo "Character at position $i: $char"
82
+ ascii_value=$(printf "%d" "'$char")
83
+ echo "ASCII value of $char: $ascii_value"
84
+ done
85
+ norm[3]="${norm[3]//+([[:space:]])/}" # 移除所有空白字符
86
+
87
+ [ "${norm[3]}" == "" ] || norm[3]=".${norm[3]}"
88
+ fi
73
89
# Save it
74
90
IFS=
75
91
echo "GO_VERSION=${norm[*]}" >> $GITHUB_ENV
92
+ echo "${norm[0]}"
93
+ echo "${norm[1]}"
94
+ echo "${norm[2]}"
95
+ echo "${norm[3]}"
96
+ echo "${norm[*]}"
97
+
76
98
77
99
with :
78
100
fetch-depth : 1
You can’t perform that action at this time.
0 commit comments