Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(82)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 179050043: code review 179050043: Clarify Dial docstrings.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by Profpatsch
Modified:
11 years ago
Reviewers:
CC:
golang-codereviews, bradfitz
Visibility:
Public.
Clarify Dial docstrings. Reference net.Dial’s addr scheme where necessary. Improve net/smtp/auth.go "wrong host name" error. Fixes issue 9140.

Patch Set 1 #

Patch Set 2 : diff -r 3916b070c5f35fbff5321e9842e2dd38002b6637 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 3916b070c5f35fbff5321e9842e2dd38002b6637 https://code.google.com/p/go/ #

Created: 11 years, 1 month ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -4 lines) Patch
M src/net/rpc/client.go View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/net/rpc/jsonrpc/client.go View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/net/smtp/auth.go View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/net/smtp/smtp.go View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/net/smtp/smtp_test.go View 1 1 chunk +1 line, -1 line 0 comments Download
Total messages: 7
|
Profpatsch
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 1 month ago (2014年11月20日 17:29:43 UTC) #1
Hello golang-codereviews@googlegroups.com,
I'd like you to review this change to
https://code.google.com/p/go/ 
Sign in to reply to this message.
bradfitz
The tree is frozen right now. Please come back to this after Go 1.4 is ...
11 years, 1 month ago (2014年11月20日 18:26:01 UTC) #2
The tree is frozen right now. Please come back to this after Go 1.4 is out.
Also, these need to be in separate changes and need to have the proper
subjects, starting with the package names they change.
On Thu, Nov 20, 2014 at 9:29 AM, <Ephrones@gmail.com> wrote:
> Reviewers: golang-codereviews,
>
> Message:
> Hello golang-codereviews@googlegroups.com,
>
> I'd like you to review this change to
> https://code.google.com/p/go/
>
>
> Description:
> Clarify Dial docstrings.
>
> Reference net.Dial’s addr scheme where necessary.
> Improve net/smtp/auth.go "wrong host name" error.
> Fixes issue 9140.
>
> Please review this at https://codereview.appspot.com/179050043/
>
> Affected files (+9, -4 lines):
> M src/net/rpc/client.go
> M src/net/rpc/jsonrpc/client.go
> M src/net/smtp/auth.go
> M src/net/smtp/smtp.go
> M src/net/smtp/smtp_test.go
>
>
> Index: src/net/rpc/client.go
> ===================================================================
> --- a/src/net/rpc/client.go
> +++ b/src/net/rpc/client.go
> @@ -265,7 +265,8 @@
> }
> }
>
> -// Dial connects to an RPC server at the specified network address.
> +// Dial connects to an RPC server at the specified network address using
> +// net.Dial.
> func Dial(network, address string) (*Client, error) {
> conn, err := net.Dial(network, address)
> if err != nil {
> Index: src/net/rpc/jsonrpc/client.go
> ===================================================================
> --- a/src/net/rpc/jsonrpc/client.go
> +++ b/src/net/rpc/jsonrpc/client.go
> @@ -114,6 +114,8 @@
> }
>
> // Dial connects to a JSON-RPC server at the specified network address.
> +// The address must include a port number, its formatting is further
> described
> +// in net.Dial.
> func Dial(network, address string) (*rpc.Client, error) {
> conn, err := net.Dial(network, address)
> if err != nil {
> Index: src/net/smtp/auth.go
> ===================================================================
> --- a/src/net/smtp/auth.go
> +++ b/src/net/smtp/auth.go
> @@ -66,7 +66,8 @@
> }
> }
> if server.Name != a.host {
> - return "", nil, errors.New("wrong host name")
> + return "", nil, fmt.Errorf("wrong host name\n(%s, should
> be %s)",
> + server.Name, a.host)
> }
> resp := []byte(a.identity + "\x00" + a.username + "\x00" +
> a.password)
> return "PLAIN", resp, nil
> Index: src/net/smtp/smtp.go
> ===================================================================
> --- a/src/net/smtp/smtp.go
> +++ b/src/net/smtp/smtp.go
> @@ -41,7 +41,8 @@
> }
>
> // Dial returns a new Client connected to an SMTP server at addr.
> -// The addr must include a port number.
> +// The addr must include a port number, its formatting is further
> described in
> +// net.Dial.
> func Dial(addr string) (*Client, error) {
> conn, err := net.Dial("tcp", addr)
> if err != nil {
> Index: src/net/smtp/smtp_test.go
> ===================================================================
> --- a/src/net/smtp/smtp_test.go
> +++ b/src/net/smtp/smtp_test.go
> @@ -79,7 +79,7 @@
> },
> {
> server: &ServerInfo{Name: "attacker", TLS: true},
> - err: "wrong host name",
> + err: "wrong host name\t(attacker, should be
> servername)",
> },
> }
> for i, tt := range tests {
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-codereviews" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-codereviews+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
Sign in to reply to this message.
ephrones_gmail.com
> Also, these need to be in separate changes and need to have the proper ...
11 years, 1 month ago (2014年11月20日 22:38:36 UTC) #3
> Also, these need to be in separate changes and need to have the proper
subjects, starting with the package names they change.
You mean one for the error message and one for the docstrings?
I wonder how to do that ...
On Thu, Nov 20, 2014 at 7:26 PM, Brad Fitzpatrick <bradfitz@golang.org>
wrote:
> The tree is frozen right now. Please come back to this after Go 1.4 is out.
>
> Also, these need to be in separate changes and need to have the proper
> subjects, starting with the package names they change.
>
>
>
> On Thu, Nov 20, 2014 at 9:29 AM, <Ephrones@gmail.com> wrote:
>
>> Reviewers: golang-codereviews,
>>
>> Message:
>> Hello golang-codereviews@googlegroups.com,
>>
>> I'd like you to review this change to
>> https://code.google.com/p/go/
>>
>>
>> Description:
>> Clarify Dial docstrings.
>>
>> Reference net.Dial’s addr scheme where necessary.
>> Improve net/smtp/auth.go "wrong host name" error.
>> Fixes issue 9140.
>>
>> Please review this at https://codereview.appspot.com/179050043/
>>
>> Affected files (+9, -4 lines):
>> M src/net/rpc/client.go
>> M src/net/rpc/jsonrpc/client.go
>> M src/net/smtp/auth.go
>> M src/net/smtp/smtp.go
>> M src/net/smtp/smtp_test.go
>>
>>
>> Index: src/net/rpc/client.go
>> ===================================================================
>> --- a/src/net/rpc/client.go
>> +++ b/src/net/rpc/client.go
>> @@ -265,7 +265,8 @@
>> }
>> }
>>
>> -// Dial connects to an RPC server at the specified network address.
>> +// Dial connects to an RPC server at the specified network address using
>> +// net.Dial.
>> func Dial(network, address string) (*Client, error) {
>> conn, err := net.Dial(network, address)
>> if err != nil {
>> Index: src/net/rpc/jsonrpc/client.go
>> ===================================================================
>> --- a/src/net/rpc/jsonrpc/client.go
>> +++ b/src/net/rpc/jsonrpc/client.go
>> @@ -114,6 +114,8 @@
>> }
>>
>> // Dial connects to a JSON-RPC server at the specified network address.
>> +// The address must include a port number, its formatting is further
>> described
>> +// in net.Dial.
>> func Dial(network, address string) (*rpc.Client, error) {
>> conn, err := net.Dial(network, address)
>> if err != nil {
>> Index: src/net/smtp/auth.go
>> ===================================================================
>> --- a/src/net/smtp/auth.go
>> +++ b/src/net/smtp/auth.go
>> @@ -66,7 +66,8 @@
>> }
>> }
>> if server.Name != a.host {
>> - return "", nil, errors.New("wrong host name")
>> + return "", nil, fmt.Errorf("wrong host name\n(%s, should
>> be %s)",
>> + server.Name, a.host)
>> }
>> resp := []byte(a.identity + "\x00" + a.username + "\x00" +
>> a.password)
>> return "PLAIN", resp, nil
>> Index: src/net/smtp/smtp.go
>> ===================================================================
>> --- a/src/net/smtp/smtp.go
>> +++ b/src/net/smtp/smtp.go
>> @@ -41,7 +41,8 @@
>> }
>>
>> // Dial returns a new Client connected to an SMTP server at addr.
>> -// The addr must include a port number.
>> +// The addr must include a port number, its formatting is further
>> described in
>> +// net.Dial.
>> func Dial(addr string) (*Client, error) {
>> conn, err := net.Dial("tcp", addr)
>> if err != nil {
>> Index: src/net/smtp/smtp_test.go
>> ===================================================================
>> --- a/src/net/smtp/smtp_test.go
>> +++ b/src/net/smtp/smtp_test.go
>> @@ -79,7 +79,7 @@
>> },
>> {
>> server: &ServerInfo{Name: "attacker", TLS: true},
>> - err: "wrong host name",
>> + err: "wrong host name\t(attacker, should be
>> servername)",
>> },
>> }
>> for i, tt := range tests {
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-codereviews" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-codereviews+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
Sign in to reply to this message.
bradfitz
No, one for rpc and one for smtp On Nov 20, 2014 2:39 PM, "Ephrones ...
11 years, 1 month ago (2014年11月20日 23:42:12 UTC) #4
No, one for rpc and one for smtp
On Nov 20, 2014 2:39 PM, "Ephrones Sharp" <ephrones@gmail.com> wrote:
> > Also, these need to be in separate changes and need to have the proper
> subjects, starting with the package names they change.
>
> You mean one for the error message and one for the docstrings?
>
> I wonder how to do that ...
>
> On Thu, Nov 20, 2014 at 7:26 PM, Brad Fitzpatrick <bradfitz@golang.org>
> wrote:
>
>> The tree is frozen right now. Please come back to this after Go 1.4 is
>> out.
>>
>> Also, these need to be in separate changes and need to have the proper
>> subjects, starting with the package names they change.
>>
>>
>>
>> On Thu, Nov 20, 2014 at 9:29 AM, <Ephrones@gmail.com> wrote:
>>
>>> Reviewers: golang-codereviews,
>>>
>>> Message:
>>> Hello golang-codereviews@googlegroups.com,
>>>
>>> I'd like you to review this change to
>>> https://code.google.com/p/go/
>>>
>>>
>>> Description:
>>> Clarify Dial docstrings.
>>>
>>> Reference net.Dial’s addr scheme where necessary.
>>> Improve net/smtp/auth.go "wrong host name" error.
>>> Fixes issue 9140.
>>>
>>> Please review this at https://codereview.appspot.com/179050043/
>>>
>>> Affected files (+9, -4 lines):
>>> M src/net/rpc/client.go
>>> M src/net/rpc/jsonrpc/client.go
>>> M src/net/smtp/auth.go
>>> M src/net/smtp/smtp.go
>>> M src/net/smtp/smtp_test.go
>>>
>>>
>>> Index: src/net/rpc/client.go
>>> ===================================================================
>>> --- a/src/net/rpc/client.go
>>> +++ b/src/net/rpc/client.go
>>> @@ -265,7 +265,8 @@
>>> }
>>> }
>>>
>>> -// Dial connects to an RPC server at the specified network address.
>>> +// Dial connects to an RPC server at the specified network address using
>>> +// net.Dial.
>>> func Dial(network, address string) (*Client, error) {
>>> conn, err := net.Dial(network, address)
>>> if err != nil {
>>> Index: src/net/rpc/jsonrpc/client.go
>>> ===================================================================
>>> --- a/src/net/rpc/jsonrpc/client.go
>>> +++ b/src/net/rpc/jsonrpc/client.go
>>> @@ -114,6 +114,8 @@
>>> }
>>>
>>> // Dial connects to a JSON-RPC server at the specified network address.
>>> +// The address must include a port number, its formatting is further
>>> described
>>> +// in net.Dial.
>>> func Dial(network, address string) (*rpc.Client, error) {
>>> conn, err := net.Dial(network, address)
>>> if err != nil {
>>> Index: src/net/smtp/auth.go
>>> ===================================================================
>>> --- a/src/net/smtp/auth.go
>>> +++ b/src/net/smtp/auth.go
>>> @@ -66,7 +66,8 @@
>>> }
>>> }
>>> if server.Name != a.host {
>>> - return "", nil, errors.New("wrong host name")
>>> + return "", nil, fmt.Errorf("wrong host name\n(%s, should
>>> be %s)",
>>> + server.Name, a.host)
>>> }
>>> resp := []byte(a.identity + "\x00" + a.username + "\x00" +
>>> a.password)
>>> return "PLAIN", resp, nil
>>> Index: src/net/smtp/smtp.go
>>> ===================================================================
>>> --- a/src/net/smtp/smtp.go
>>> +++ b/src/net/smtp/smtp.go
>>> @@ -41,7 +41,8 @@
>>> }
>>>
>>> // Dial returns a new Client connected to an SMTP server at addr.
>>> -// The addr must include a port number.
>>> +// The addr must include a port number, its formatting is further
>>> described in
>>> +// net.Dial.
>>> func Dial(addr string) (*Client, error) {
>>> conn, err := net.Dial("tcp", addr)
>>> if err != nil {
>>> Index: src/net/smtp/smtp_test.go
>>> ===================================================================
>>> --- a/src/net/smtp/smtp_test.go
>>> +++ b/src/net/smtp/smtp_test.go
>>> @@ -79,7 +79,7 @@
>>> },
>>> {
>>> server: &ServerInfo{Name: "attacker", TLS: true},
>>> - err: "wrong host name",
>>> + err: "wrong host name\t(attacker, should be
>>> servername)",
>>> },
>>> }
>>> for i, tt := range tests {
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-codereviews" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to golang-codereviews+unsubscribe@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-codereviews" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-codereviews+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
Sign in to reply to this message.
ephrones_gmail.com
> No, one for rpc and one for smtp imho those changes belong together, but ...
11 years, 1 month ago (2014年11月21日 15:43:04 UTC) #5
> No, one for rpc and one for smtp
imho those changes belong together, but as you wish.
Sign in to reply to this message.
bradfitz
Also no newlines in error messages. On Fri, Nov 21, 2014 at 7:43 AM, Ephrones ...
11 years, 1 month ago (2014年11月21日 18:39:26 UTC) #6
Also no newlines in error messages.
On Fri, Nov 21, 2014 at 7:43 AM, Ephrones Sharp <ephrones@gmail.com> wrote:
> > No, one for rpc and one for smtp
>
> imho those changes belong together, but as you wish.
>
Sign in to reply to this message.
gobot
R=close To the author of this CL: The Go project has moved to Gerrit Code ...
11 years ago (2014年12月19日 05:16:40 UTC) #7
R=close
To the author of this CL:
The Go project has moved to Gerrit Code Review.
If this CL should be continued, please see the latest version of
https://golang.org/doc/contribute.html for instructions on
how to set up Git and the Go project's Gerrit codereview plugin,
and then create a new change with your current code.
If there has been discussion on this CL, please give a link to it
(golang.org/cl/179050043 is best) in the description in your
new CL.
Thanks very much.
Sign in to reply to this message.
|
Powered by Google App Engine
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /