FAQ
I am just confused why use []string as values and not just string. Why is
this required ?

For example - Say I have a cache-control header then this should be enough
if a string type was used for value and not a slice, then
*Header["cache-control"] = ["max-age=200; public"]*

Am I wrong to conclude that ?

Or should this be the correct way ?
*Header["cache-control"] = ["max-age=200", "public"]*

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Naoki INADA at Apr 6, 2015 at 7:13 am
    Cache-Control: max-age=200; public

    becomes

    header["Cache-Control"] = {"max-age=200; public"}

    ---

    Cache-Control: max-age=200
    Cache-Control: public

    becomes

    header["Cache-Control"] = {"max-age=200", "public"}

    On Monday, April 6, 2015 at 3:12:10 PM UTC+9, Noob wrote:

    I am just confused why use []string as values and not just string. Why is
    this required ?

    For example - Say I have a cache-control header then this should be enough
    if a string type was used for value and not a slice, then
    *Header["cache-control"] = ["max-age=200; public"]*

    Am I wrong to conclude that ?

    Or should this be the correct way ?
    *Header["cache-control"] = ["max-age=200", "public"]*
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/d/optout.
  • David Symonds at Apr 6, 2015 at 7:51 am

    On 6 April 2015 at 16:12, Noob wrote:

    I am just confused why use []string as values and not just string. Why is
    this required ?
    HTTP headers may occur more than once.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 6, '15 at 6:12a
activeApr 6, '15 at 7:51a
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2023 Grokbase