FAQ
See http://play.golang.org/p/Dr3gVjctk6

It makes sense to me that printf requires multiple arguments, otherwise you
should just use print. However, I think this should throw a parse error
instead of panicking during Execute, so I just want to see if I'm missing
something before filing a bug report.

--
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 golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Tomwilde at Oct 16, 2014 at 7:09 pm
    how would an error be thrown?

    --
    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 golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Js at Oct 16, 2014 at 7:40 pm
    By testing for the scenario that is currently causing an Execute-time panic
    at Parse-time. Whatever the bug is, it's triggered when printf is called
    with no parameters in a pipeline. If you replace:

    "{{" | printf

    with:

    printf "{{"

    it runs without panicking. Calling:

    "{{" | print

    works fine as well, so it's not a problem for all functions.
    On Thursday, October 16, 2014 3:09:50 PM UTC-4, tomwilde wrote:

    how would an error be thrown?
    --
    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 golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Js at Oct 16, 2014 at 7:46 pm
    This is a more illustrative example:

    http://play.golang.org/p/iKMQTtM3Vb
    On Thursday, October 16, 2014 3:39:59 PM UTC-4, Js wrote:

    By testing for the scenario that is currently causing an Execute-time
    panic at Parse-time. Whatever the bug is, it's triggered when printf is
    called with no parameters in a pipeline. If you replace:

    "{{" | printf

    with:

    printf "{{"

    it runs without panicking. Calling:

    "{{" | print

    works fine as well, so it's not a problem for all functions.
    On Thursday, October 16, 2014 3:09:50 PM UTC-4, tomwilde wrote:

    how would an error be thrown?
    --
    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 golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Tomwilde at Oct 17, 2014 at 10:32 am

    On Thursday, October 16, 2014 9:39:59 PM UTC+2, Js wrote:
    If you replace:

    "{{" | printf

    with:

    printf "{{"

    it runs without panicking.
    That looks like a bug and you should report it.

    Detecting type-errors in templates is difficult, though. For a number of
    reasons.

    --
    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 golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Js at Oct 17, 2014 at 12:37 pm
    Thanks

    https://code.google.com/p/go/issues/detail?id=8950
    On Friday, October 17, 2014 6:32:44 AM UTC-4, tomwilde wrote:
    On Thursday, October 16, 2014 9:39:59 PM UTC+2, Js wrote:

    If you replace:

    "{{" | printf

    with:

    printf "{{"

    it runs without panicking.
    That looks like a bug and you should report it.

    Detecting type-errors in templates is difficult, though. For a number of
    reasons.
    --
    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 golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rjeczalik at Oct 16, 2014 at 7:44 pm

    On 16 October 2014 21:09, tomwilde wrote:
    how would an error be thrown?
    template.Parse should return error saying that number of fixed arguments
    for printf is less than expected.

    --
    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 golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 16, '14 at 6:02p
activeOct 17, '14 at 12:37p
posts7
users3
websitegolang.org

3 users in discussion

Js: 4 posts Tomwilde: 2 posts Rjeczalik: 1 post

People

Translate

site design / logo © 2022 Grokbase