s/a specified/the specified/. You say code and error message in the doc comment but error ...
15 years, 4 months ago
(2010-03-19 01:15:20 UTC)
#2
s/a specified/the specified/.
You say code and error message in the doc comment
but error message and code in the signature.
I think the doc comment is right and the func should change.
Russ
On Thu, Mar 18, 2010 at 18:13, <adg@golang.org> wrote:
> Reviewers: r, rsc,
>
> Message:
> Hello r, rsc (cc: golang-dev@googlegroups.com),
>
> I'd like you to review this change.
>
>
> Description:
> http: add Error helper function
>
> Please review this at http://codereview.appspot.com/626042/show
>
> Affected files:
> M src/pkg/http/server.go
>
>
> Index: src/pkg/http/server.go
> ===================================================================
> --- a/src/pkg/http/server.go
> +++ b/src/pkg/http/server.go
> @@ -339,6 +339,13 @@
> // that replies to each request with a ``404 page not found'' reply.
> func NotFoundHandler() Handler { return HandlerFunc(NotFound) }
>
> +// Error replies to the request with a specified HTTP code and error
> message.
> +func Error(c *Conn, error string, code int) {
> + c.SetHeader("Content-Type", "text/plain; charset=utf-8")
> + c.WriteHeader(code)
> + io.WriteString(c, error)
> +}
> +
> // Redirect replies to the request with a redirect to url,
> // which may be a path relative to the request path.
> func Redirect(c *Conn, url string, code int) {
>
>
>
On 19 March 2010 12:15, Russ Cox <rsc@golang.org> wrote: > s/a specified/the specified/. > > ...
15 years, 4 months ago
(2010-03-19 01:17:25 UTC)
#3
On 19 March 2010 12:15, Russ Cox <rsc@golang.org> wrote:
> s/a specified/the specified/.
>
> You say code and error message in the doc comment
> but error message and code in the signature.
> I think the doc comment is right and the func should change.
It then becomes inconsistent with Redirect.
> Russ
>
>
> On Thu, Mar 18, 2010 at 18:13, <adg@golang.org> wrote:
>> Reviewers: r, rsc,
>>
>> Message:
>> Hello r, rsc (cc: golang-dev@googlegroups.com),
>>
>> I'd like you to review this change.
>>
>>
>> Description:
>> http: add Error helper function
>>
>> Please review this at http://codereview.appspot.com/626042/show
>>
>> Affected files:
>> M src/pkg/http/server.go
>>
>>
>> Index: src/pkg/http/server.go
>> ===================================================================
>> --- a/src/pkg/http/server.go
>> +++ b/src/pkg/http/server.go
>> @@ -339,6 +339,13 @@
>> // that replies to each request with a ``404 page not found'' reply.
>> func NotFoundHandler() Handler { return HandlerFunc(NotFound) }
>>
>> +// Error replies to the request with a specified HTTP code and error
>> message.
>> +func Error(c *Conn, error string, code int) {
>> + c.SetHeader("Content-Type", "text/plain; charset=utf-8")
>> + c.WriteHeader(code)
>> + io.WriteString(c, error)
>> +}
>> +
>> // Redirect replies to the request with a redirect to url,
>> // which may be a path relative to the request path.
>> func Redirect(c *Conn, url string, code int) {
>>
>>
>>
>
Issue 626042: code review 626042: http: add Error helper function
(Closed)
Created 15 years, 4 months ago by adg
Modified 15 years, 4 months ago
Reviewers:
Base URL:
Comments: 2