FAQ
Is there any way to "peek" at the number of characters Println will output
before calling Println?

--
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/groups/opt_out.

Search Discussions

  • Jimmy frasche at May 9, 2013 at 2:38 am
    Call Sprintln, take the length of the result, and then pass it to Print

    --
    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/groups/opt_out.
  • Brendan Tracey at May 9, 2013 at 2:40 am
    Awesome. Thanks.
    On May 8, 2013, at 7:38 PM, jimmy frasche wrote:

    Call Sprintln, take the length of the result, and then pass it to Print
    --
    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/groups/opt_out.
  • Hraban Luyat at May 9, 2013 at 2:43 am
    or use the integer return value without creating a temporary string:

    size, _ := fmt.Fprintln(ioutil.Discard, "foo", "bar")

    http://play.golang.org/p/VFwO_cF7Yd
    On Thursday, May 9, 2013 4:38:14 AM UTC+2, soapboxcicero wrote:

    Call Sprintln, take the length of the result, and then pass it to Print
    --
    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/groups/opt_out.
  • Dan Kortschak at May 9, 2013 at 2:49 am

    On Wed, 2013-05-08 at 19:33 -0700, Brendan Tracey wrote:
    Is there any way to "peek" at the number of characters Println will
    output before calling Println?
    fmt.Sprintln

    --
    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/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMay 9, '13 at 2:33a
activeMay 9, '13 at 2:49a
posts5
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase