Test against Go 1.20, maybe fix lint issue

This commit is contained in:
Neil Alexander 2023-02-26 21:31:20 +00:00
parent 4189053cfc
commit 6d6c408957
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944
2 changed files with 6 additions and 5 deletions

View File

@ -51,7 +51,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
goversion: ["1.17", "1.18", "1.19"] goversion: ["1.17", "1.18", "1.19", "1.20"]
name: Build & Test (Linux, Go ${{ matrix.goversion }}) name: Build & Test (Linux, Go ${{ matrix.goversion }})
needs: [lint] needs: [lint]
@ -75,7 +75,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
goversion: ["1.17", "1.18", "1.19"] goversion: ["1.17", "1.18", "1.19", "1.20"]
name: Build & Test (Windows, Go ${{ matrix.goversion }}) name: Build & Test (Windows, Go ${{ matrix.goversion }})
needs: [lint] needs: [lint]
@ -99,7 +99,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
goversion: ["1.17", "1.18", "1.19"] goversion: ["1.17", "1.18", "1.19", "1.20"]
name: Build & Test (macOS, Go ${{ matrix.goversion }}) name: Build & Test (macOS, Go ${{ matrix.goversion }})
needs: [lint] needs: [lint]

View File

@ -107,7 +107,8 @@ func (tun *TunAdapter) _start() error {
} }
tun.addr = tun.rwc.Address() tun.addr = tun.rwc.Address()
tun.subnet = tun.rwc.Subnet() tun.subnet = tun.rwc.Subnet()
addr := fmt.Sprintf("%s/%d", net.IP(tun.addr[:]).String(), 8*len(address.GetPrefix())-1) prefix := address.GetPrefix()
addr := fmt.Sprintf("%s/%d", net.IP(tun.addr[:]).String(), 8*len(prefix)-1)
if tun.config.name == "none" || tun.config.name == "dummy" { if tun.config.name == "none" || tun.config.name == "dummy" {
tun.log.Debugln("Not starting TUN as ifname is none or dummy") tun.log.Debugln("Not starting TUN as ifname is none or dummy")
tun.isEnabled = false tun.isEnabled = false