FAQ
Hi Gophers,

my most recent project typebrowser<https://github.com/arnehormann/typebrowser> is
an advanced replacement for println debugging.

It creates a blocking channel you can stuff values into.
Your program is blocked until you open a browser and have a look at the
type.
The README should get you started, here's a demo of what *reflect.Struct
would look like:
http://bl.ocks.org/arnehormann/raw/5775864/
The buttons at the top won't work, usually they load the next type.

I hope you like it.
The concept can be vastly extended :-)

--
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

  • Peter Kleiweg at Jun 13, 2013 at 8:12 pm
    Looks great.

    Am I not supposed to see the values as well? And the tags?

    --
    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.
  • Arne Hormann at Jun 13, 2013 at 9:06 pm
    Hi Peter,

    thank you! You can't see the tags, but they - and a lot more - are there
    (in the html sources: data-tag). I just didn't include them in the css.

    I do have to disappoint you concerning the values, though. It's not
    possible without unsafe - which I'd like to avoid.
    Even without that limitation, I still wouldn't know how to convert an
    arbitrary value to a representation displayable in the browser.
    How do I know a []byte is a jpeg for instance?

    Let's just say I named it typebrowser for a reason. But it's still helpfull
    to have a look at the memory layout or get to know what hides behind an
    interface{}.

    Arne


    Am Donnerstag, 13. Juni 2013 22:12:36 UTC+2 schrieb Peter Kleiweg:
    Looks great.

    Am I not supposed to see the values as well? And the tags?
    --
    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.
  • Kyle Lemons at Jun 14, 2013 at 1:46 am

    On Thu, Jun 13, 2013 at 2:06 PM, Arne Hormann wrote:

    Hi Peter,

    thank you! You can't see the tags, but they - and a lot more - are there
    (in the html sources: data-tag). I just didn't include them in the css.

    I do have to disappoint you concerning the values, though. It's not
    possible without unsafe - which I'd like to avoid.
    Even without that limitation, I still wouldn't know how to convert an
    arbitrary value to a representation displayable in the browser.
    How do I know a []byte is a jpeg for instance?
    You can go as far with this as you wish :). You could use content-type
    detection on []byte and string to see what it is; if it's all ascii and
    reasonably short, you can assume it's displayable. You could also restrict
    yourself to exported-only symbols, which makes it easier to deal with
    reflect (you can get interface{} from them).

    To see how to poke arbitrarily around in a value, see
    http://godoc.org/github.com/kylelemons/godebug/pretty

    Let's just say I named it typebrowser for a reason. But it's still
    helpfull to have a look at the memory layout or get to know what hides
    behind an interface{}.

    Arne


    Am Donnerstag, 13. Juni 2013 22:12:36 UTC+2 schrieb Peter Kleiweg:
    Looks great.

    Am I not supposed to see the values as well? And the tags?

    --
    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.

    --
    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.
  • Arne Hormann at Jun 14, 2013 at 5:28 am

    Am Freitag, 14. Juni 2013 03:46:28 UTC+2 schrieb Kyle Lemons:

    On Thu, Jun 13, 2013 at 2:06 PM, Arne Hormann <arneh...@gmail.com<javascript:>
    wrote:
    Hi Peter,

    thank you! You can't see the tags, but they - and a lot more - are there
    (in the html sources: data-tag). I just didn't include them in the css.

    I do have to disappoint you concerning the values, though. It's not
    possible without unsafe - which I'd like to avoid.
    Even without that limitation, I still wouldn't know how to convert an
    arbitrary value to a representation displayable in the browser.
    How do I know a []byte is a jpeg for instance?
    You can go as far with this as you wish :). You could use content-type
    detection on []byte and string to see what it is; if it's all ascii and
    reasonably short, you can assume it's displayable. You could also restrict
    yourself to exported-only symbols, which makes it easier to deal with
    reflect (you can get interface{} from them).
    Right, but for now I'm mainly interested in the type - including all
    included types, even the unexported ones.
    In the next iterations I want to export it as JSON, add a viewer with godoc
    links, ...
    Additionally, the amount of output is very manageable and I don't have to
    make it configurable.

    To see how to poke arbitrarily around in a value, see
    http://godoc.org/github.com/kylelemons/godebug/pretty

    Your library looks great! I'll probably use it sometime soon...

    Let's just say I named it typebrowser for a reason. But it's still
    helpfull to have a look at the memory layout or get to know what hides
    behind an interface{}.

    Arne


    Am Donnerstag, 13. Juni 2013 22:12:36 UTC+2 schrieb Peter Kleiweg:
    Looks great.

    Am I not supposed to see the values as well? And the tags?

    --
    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...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.

    --
    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.
  • Dobrosław Żybort at Jun 14, 2013 at 7:06 am

    To see how to poke arbitrarily around in a value, see

    Your library looks great! I'll probably use it sometime soon...
    There is also:

        1. http://godoc.org/github.com/davecgh/go-spew/spew
        (more info about go-spew:
        https://blog.cyphertite.com/go-spew-a-journey-into-dumping-go-data-structures/
        )
        2. http://godoc.org/github.com/kr/pretty

    Best regards,

    Dobrosław Żybort

    --
    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
postedJun 13, '13 at 7:07p
activeJun 14, '13 at 7:06a
posts6
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase