FAQ
https://codereview.appspot.com/11698045/diff/14001/src/pkg/net/url/url.go
File src/pkg/net/url/url.go (right):

https://codereview.appspot.com/11698045/diff/14001/src/pkg/net/url/url.go#newcode463
src/pkg/net/url/url.go:463: if u.Path[0] != '/' {
You can save two lines by:

if u.Path != "" && u.Path[0] != '/' {

    or

if len(u.Path) != 0 && u.Path[0] != '/' {

https://codereview.appspot.com/11698045/

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Scottwferg at Jul 24, 2013 at 1:25 pm
    On 2013/07/24 07:49:04, 0xjnml wrote:

    https://codereview.appspot.com/11698045/diff/14001/src/pkg/net/url/url.go
    File src/pkg/net/url/url.go (right):

    https://codereview.appspot.com/11698045/diff/14001/src/pkg/net/url/url.go#newcode463
    src/pkg/net/url/url.go:463: if u.Path[0] != '/' {
    You can save two lines by:
    if u.Path != "" && u.Path[0] != '/' {
    or
    if len(u.Path) != 0 && u.Path[0] != '/' {
    Good point, fixed.

    https://codereview.appspot.com/11698045/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Russ Cox at Aug 1, 2013 at 10:05 pm
    LGTM

    Please complete a CLA as described at
    golang.org/doc/contribute.html#copyright

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Rsc at Aug 1, 2013 at 9:17 pm
    LGTM

    There's no good answer here: no URL we generate will reproduce the
    original struct. However, putting the slash in seems to generate a
    struct closer to the original, in that the first path element will not
    be concatenated to the host name.


    https://codereview.appspot.com/11698045/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Scottwferg at Aug 1, 2013 at 10:45 pm

    On 2013/08/01 22:05:21, rsc wrote:
    LGTM
    Please complete a CLA as described at
    golang.org/doc/contribute.html#copyright
    Done.

    https://codereview.appspot.com/11698045/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Bradfitz at Aug 1, 2013 at 10:53 pm
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=03265149ced8 ***

    net/url: prepend slash to path in String()

    Previously if a path was set manually without a leading /, String()
    would not insert the slash when writing its output. This would lead
    to situations where a URL that should be http://www.google.com/search
    is output as http://www.google.comsearch

    Fixes issue 5927.

    R=golang-dev, bradfitz, rsc, 0xjnml
    CC=golang-dev
    https://codereview.appspot.com/11698045

    Committer: Brad Fitzpatrick <bradfitz@golang.org>


    https://codereview.appspot.com/11698045/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedJul 24, '13 at 7:49a
activeAug 1, '13 at 10:53p
posts6
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase