Skip to content

Commit 9b07cb7

Browse files
committed
fix: handle versions without minor like 1.16
1.16.x matches 1.16 if no minor version is available yet. Signed-off-by: Maxime Soulé <btik-git@scoubidou.com>
1 parent e0a5d60 commit 9b07cb7

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ usage: install-go.pl VERSION [INSTALLATION_DIR]
1616
- `VERSION` can be:
1717
- any version of go (1.9, 1.10.3);
1818
- a version without patch version specified, meaning the last one
19-
(1.11.x, 1.15.x);
19+
(1.11.x, 1.16.x);
2020
- `tip`, the latest HEAD.
2121

2222
- `INSTALLATION_DIR` the directory in which install the `go/`
@@ -34,15 +34,15 @@ jobs:
3434
test:
3535
strategy:
3636
matrix:
37-
go-version: [1.9.x, 1.10.x, 1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x, tip]
37+
go-version: [1.9.x, 1.10.x, 1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x, 1.16.x, tip]
3838
os: [ubuntu-latest, windows-latest, macos-latest]
3939

4040
runs-on: ${{ matrix.os }}
4141

4242
steps:
4343
- name: Setup go
4444
run: |
45-
curl -sL https://raw.githubusercontent.com/maxatome/install-go/v2.0/install-go.pl |
45+
curl -sL https://raw.githubusercontent.com/maxatome/install-go/v2.1/install-go.pl |
4646
perl - ${{ matrix.go-version }} $HOME/go
4747
4848
- name: Checkout code
@@ -56,10 +56,10 @@ jobs:
5656
```
5757
5858
59-
### Install last version of go 1.15 in current directory:
59+
### Install last version of go 1.16 in current directory:
6060
6161
```
62-
./install-go.pl 1.15.x
62+
./install-go.pl 1.16.x
6363
```
6464

6565
then

install-go.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ sub resolve_target
133133

134134
if ($last_minor < ($1 // 0))
135135
{
136-
$last_minor = $1 // 0;
136+
$last_minor = $1;
137137
$found = 1;
138138
}
139139
}

0 commit comments

Comments
 (0)