Skip to content

feat: add joinHostPort template function - #491

Closed
AdamMagued wants to merge 1 commit into
Masterminds:masterfrom
AdamMagued:feat-add-join-host-port
Closed

AdamMagued wants to merge 1 commit into
Masterminds:masterfrom
AdamMagued:feat-add-join-host-port

Conversation

@AdamMagued

Copy link
Copy Markdown

Summary

Adds the joinHostPort template function to format network addresses using Go standard library net.JoinHostPort(fmt.Sprint(host), fmt.Sprint(port)).

Details

  • Implements joinHostPort(host, port interface{}) string in network.go using net.JoinHostPort.
  • Registers "joinHostPort": joinHostPort in GenericFuncMap().
  • Updates documentation in docs/network.md and docs/index.md.
  • Adds regression unit tests in network_test.go covering IPv4 (127.0.0.1, 8080), IPv6 (::1, 443), and hostname (localhost, "http") with direct invocation and template pipeline execution.

Fixes #472

Add joinHostPort template function using net.JoinHostPort to consistently
format network addresses for IPv4, IPv6, and hostnames. Register the function
in GenericFuncMap and add regression tests covering IPv4, IPv6, and hostname inputs.

Fixes Masterminds#472
@AdamMagued

Copy link
Copy Markdown
Author

Closing in favor of earlier community PR #477 to keep the review queue clean.

@AdamMagued AdamMagued closed this Oct 2, 2026
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.

Add joinHostPort

1 participant