From fdd823d2cba3e13005fce57c046d3d3b0480d5a8 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Wed, 17 Mar 2021 23:18:07 +0100 Subject: [PATCH] lib/osutil: Remove unused code --- lib/osutil/net.go | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 lib/osutil/net.go diff --git a/lib/osutil/net.go b/lib/osutil/net.go deleted file mode 100644 index baddcd532..000000000 --- a/lib/osutil/net.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) 2015 The Syncthing Authors. -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this file, -// You can obtain one at http://mozilla.org/MPL/2.0/. - -package osutil - -import ( - "net" -) - -func interfaceAddresses(network string, intf *net.Interface) []string { - var out []string - addrs, err := intf.Addrs() - if err != nil { - return out - } - - for _, addr := range addrs { - ipnet, ok := addr.(*net.IPNet) - if ok && (network == "tcp" || (network == "tcp4" && len(ipnet.IP) == net.IPv4len) || (network == "tcp6" && len(ipnet.IP) == net.IPv6len)) { - out = append(out, ipnet.IP.String()) - } - } - - return out -}