From a16b25ad1d0150c3bfabeb1911d926bcca7c6d7c Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 19 Jun 2025 18:31:47 +0700 Subject: [PATCH] refactor: move getDNS type to os_linux.go Move getDNS type definition from dns.go to os_linux.go where it is used. Remove the now-empty dns.go file. This change improves code organization by keeping platform-specific types with their implementations. --- cmd/cli/dns.go | 4 ---- cmd/cli/os_linux.go | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 cmd/cli/dns.go diff --git a/cmd/cli/dns.go b/cmd/cli/dns.go deleted file mode 100644 index cf9d779..0000000 --- a/cmd/cli/dns.go +++ /dev/null @@ -1,4 +0,0 @@ -package cli - -//lint:ignore U1000 use in os_linux.go -type getDNS func(iface string) []string diff --git a/cmd/cli/os_linux.go b/cmd/cli/os_linux.go index e27555e..0b93b0b 100644 --- a/cmd/cli/os_linux.go +++ b/cmd/cli/os_linux.go @@ -28,6 +28,8 @@ import ( const resolvConfBackupFailedMsg = "open /etc/resolv.pre-ctrld-backup.conf: read-only file system" +type getDNS func(iface string) []string + // allocate loopback ip // sudo ip a add 127.0.0.2/24 dev lo func allocateIP(ip string) error {