docs: name NewDialer correctly in the doc comments - #19
Merged
Conversation
Four comments in ssrf.go call the constructor New. The exported function is NewDialer, and no symbol named New exists in this package. A reader who follows the deprecation message reaches a function that is not there. the Dialer example ssrf.New(...) -> ssrf.NewDialer(...) the NewDialer comment "New creates ..." -> "NewDialer creates ..." the DialContext comment "wrapper around New" -> "wrapper around NewDialer" the deprecation notice "Use New" -> "Use NewDialer" The comment on NewDialer now starts with the name of the function, as go doc expects. The README already uses NewDialer everywhere, so it needs no change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four comments in
ssrf.gocall the constructorNew. The exported function isNewDialer, and no symbol namedNewexists in this package:A reader who follows the deprecation message reaches a function that is not there. This came up while moving
chrj/toolsoff the deprecatedssrf.DialContext.The four places
Dialerdoc exampled := ssrf.New(...)d := ssrf.NewDialer(...)NewDialerdoc commentDialContextdoc commentDialContextdeprecation noticeThe third row is the one a caller actually meets: it is the text an editor shows when it marks the deprecated call.
The second row also fixes a doc convention. A comment on an exported function starts with the name of that function, and this one started with
Newwhile the function isNewDialer.Scope
Comments only. No code changes, so no behavior changes.
The README already uses
NewDialerin all 13 places, so it needs no change.go build,go test, andgolangci-lint run ./...all pass.