Skip to content

Commit a27c139

Browse files
Copilotnomeguy
andcommitted
Address code review feedback - improve readability and restore working directory
Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
1 parent be863d5 commit a27c139

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ip/ip_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func TestIsAbroadIp(t *testing.T) {
2525
wd, _ := os.Getwd()
2626
if filepath.Base(wd) == "ip" {
2727
os.Chdir("..")
28+
defer os.Chdir(wd)
2829
}
2930

3031
// Initialize the IP database

util/network.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,8 @@ func IsIntranetIp(ip string) bool {
4545
return false
4646
}
4747

48-
return parsedIP.IsPrivate() || parsedIP.IsLoopback() || parsedIP.IsLinkLocalUnicast() || parsedIP.IsLinkLocalMulticast()
48+
return parsedIP.IsPrivate() ||
49+
parsedIP.IsLoopback() ||
50+
parsedIP.IsLinkLocalUnicast() ||
51+
parsedIP.IsLinkLocalMulticast()
4952
}

0 commit comments

Comments
 (0)