all: use ++ to increment

Make the code slightly more idiomatic. No functional changes.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder
2020-12-22 11:38:24 -08:00
committed by Jason A. Donenfeld
parent d0f8e9477c
commit 1481e72107
5 changed files with 14 additions and 14 deletions

View File

@@ -124,7 +124,7 @@ func CreateTUN(name string, mtu int) (Device, error) {
if ifIndex != -1 {
tunfile, err = os.OpenFile(fmt.Sprintf("/dev/tun%d", ifIndex), unix.O_RDWR, 0)
} else {
for ifIndex = 0; ifIndex < 256; ifIndex += 1 {
for ifIndex = 0; ifIndex < 256; ifIndex++ {
tunfile, err = os.OpenFile(fmt.Sprintf("/dev/tun%d", ifIndex), unix.O_RDWR, 0)
if err == nil || !errorIsEBUSY(err) {
break