diff --git a/internal/proxy/fuse.go b/internal/proxy/fuse.go index 748b8400b..da9694fc8 100644 --- a/internal/proxy/fuse.go +++ b/internal/proxy/fuse.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows && !openbsd && !freebsd -// +build !windows,!openbsd,!freebsd package proxy diff --git a/internal/proxy/fuse_test.go b/internal/proxy/fuse_test.go index 0379c9072..02face315 100644 --- a/internal/proxy/fuse_test.go +++ b/internal/proxy/fuse_test.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows && !darwin -// +build !windows,!darwin package proxy_test diff --git a/internal/proxy/proxy.go b/internal/proxy/proxy.go index ac4aae83b..69ec48551 100644 --- a/internal/proxy/proxy.go +++ b/internal/proxy/proxy.go @@ -297,6 +297,11 @@ func dialOptions(c Config, i InstanceConnConfig) []cloudsqlconn.DialOption { default: // assume public IP by default } + if networkType(&c, i) == "unix" { + opts = append(opts, cloudsqlconn.WithMdxClientProtocolType("uds")) + } else { + opts = append(opts, cloudsqlconn.WithMdxClientProtocolType("tcp")) + } return opts } diff --git a/internal/proxy/proxy_other.go b/internal/proxy/proxy_other.go index f6199167b..b3c7180f3 100644 --- a/internal/proxy/proxy_other.go +++ b/internal/proxy/proxy_other.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows && !openbsd && !freebsd -// +build !windows,!openbsd,!freebsd package proxy diff --git a/internal/proxy/proxy_other_test.go b/internal/proxy/proxy_other_test.go index b3503848a..77d7c21bb 100644 --- a/internal/proxy/proxy_other_test.go +++ b/internal/proxy/proxy_other_test.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows -// +build !windows package proxy_test diff --git a/internal/proxy/unix.go b/internal/proxy/unix.go index 523c49451..7ecd59517 100644 --- a/internal/proxy/unix.go +++ b/internal/proxy/unix.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows -// +build !windows package proxy diff --git a/main.go b/main.go index d9188054f..4a73ee881 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,6 @@ // limitations under the License. //go:build !windows -// +build !windows package main