{"id":16835545,"url":"https://github.com/stbenjam/no-sprintf-host-port","last_synced_at":"2025-12-15T14:32:30.687Z","repository":{"id":56953773,"uuid":"478711749","full_name":"stbenjam/no-sprintf-host-port","owner":"stbenjam","description":"Go linter that checks for URL construction that won't work with IPv6","archived":false,"fork":false,"pushed_at":"2024-11-26T14:33:00.000Z","size":17,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T05:05:07.865Z","etag":null,"topics":["go","go-lang","go-linter","golang","golint","ipv6","linter"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stbenjam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-06T20:10:46.000Z","updated_at":"2024-11-27T19:51:07.000Z","dependencies_parsed_at":"2022-08-21T04:10:15.538Z","dependency_job_id":null,"html_url":"https://github.com/stbenjam/no-sprintf-host-port","commit_stats":null,"previous_names":["stbenjam/go-sprintf-host-port"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stbenjam%2Fno-sprintf-host-port","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stbenjam%2Fno-sprintf-host-port/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stbenjam%2Fno-sprintf-host-port/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stbenjam%2Fno-sprintf-host-port/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stbenjam","download_url":"https://codeload.github.com/stbenjam/no-sprintf-host-port/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345269,"owners_count":21088244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","go-lang","go-linter","golang","golint","ipv6","linter"],"created_at":"2024-10-13T12:10:43.068Z","updated_at":"2025-12-15T14:32:30.624Z","avatar_url":"https://github.com/stbenjam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# no-sprintf-host-port \n\nThe Go linter no-sprintf-host-port checks that sprintf is not used to\nconstruct a host:port combination in a URL.    A frequent pattern is for a\ndeveloper to construct a URL like this:\n\n```go\nfmt.Sprintf(\"http://%s:%d/foo\", host, port)\n```\n\nHowever, if \"host\" is an IPv6 address like `2001:4860:4860::8888`, the\nURL constructed will be invalid. IPv6 addresses must be bracketed, like this:\n\n```\nhttp://[2001:4860:4860::8888]:9443\n```\n\nThe linter  is naive, and really only looks for the most obvious cases, but where\nit's possible to infer that a URL is being constructed with  Sprintf containing a `:`,\nthis informs the user to use `net.JoinHostPort` instead.\n\n## Thanks\n\nBased on the [`go-printf-func-name`](https://github.com/jirfag/go-printf-func-name) linter,\nand this [article](https://disaev.me/p/writing-useful-go-analysis-linter/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstbenjam%2Fno-sprintf-host-port","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstbenjam%2Fno-sprintf-host-port","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstbenjam%2Fno-sprintf-host-port/lists"}