Skip to content

fix(validation): Make unix_addr check useful (#1348)#1536

Open
agentic-sanyam wants to merge 1 commit intogo-playground:masterfrom
agentic-sanyam:fix/issue-1348
Open

fix(validation): Make unix_addr check useful (#1348)#1536
agentic-sanyam wants to merge 1 commit intogo-playground:masterfrom
agentic-sanyam:fix/issue-1348

Conversation

@agentic-sanyam
Copy link

Hey folks,

This PR finally addresses #1348, where the unix_addr validation was, well, pretty much useless.

Turns out, net.ResolveUnixAddr for the "unix" network type in Go's standard library always succeeds (it just returns a UnixAddr struct with the provided name and network). This meant our isUnixAddrResolvable function always returned true, even for non-existent or invalid paths. Definitely not the behavior anyone would expect!

I've updated isUnixAddrResolvable to now leverage the existing isUnixDomainSocketExists function. This provides a much more robust check, ensuring the path actually exists and points to a valid Unix domain socket (or a Linux abstract socket).

Naturally, the TestUnixAddrValidation suite has been completely overhauled to reflect this new, stricter (and correct!) behavior. This includes:

  • Adding a skip for Windows, as Unix domain socket existence checks aren't really a thing there.
  • Dynamically creating a real Unix domain socket during the test to properly verify valid paths.
  • Expanding test cases for empty strings and non-existent paths, which now correctly fail.

Now unix_addr actually does what users expect it to do! 🎉

Cheers!

Fixes #1348

@agentic-sanyam agentic-sanyam requested a review from a team as a code owner February 28, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: unix_addr check is useless

2 participants