FAQ
Hi all,

From this post
<https://groups.google.com/forum/#!topic/golang-nuts/ZRKSJ3GPkLw>, I can
see the string implementation is in https://golang.org/src/runtime/runtime.h previously:


     struct String
     {
         byte* str;
         int32 len;
     };

But now, https://golang.org/src/runtime/runtime.h has gone. I try to grep
"string struct" in the golang source code,
but can't find string definition.

Where can I find string implementation now? Thanks in advance!

Best Regards
Nan Xiao

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

  • Jesse McNelis at Mar 23, 2016 at 4:36 am

    On Wed, Mar 23, 2016 at 2:52 PM, Nan Xiao wrote:
    Hi all,

    From this post, I can see the string implementation is in
    https://golang.org/src/runtime/runtime.h previously:

    struct String
    {
    byte* str;
    int32 len;
    };

    But now, https://golang.org/src/runtime/runtime.h has gone. I try to grep
    "string struct" in the golang source code,
    but can't find string definition.

    Where can I find string implementation now? Thanks in advance!
    https://golang.org/src/runtime/string.go#L215

    --
    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.
  • Konstantin Khomoutov at Mar 23, 2016 at 11:38 am

    On Tue, 22 Mar 2016 20:52:28 -0700 (PDT) Nan Xiao wrote:

    From this post
    <https://groups.google.com/forum/#!topic/golang-nuts/ZRKSJ3GPkLw>, I
    can see the string implementation is in
    https://golang.org/src/runtime/runtime.h previously:

    struct String
    {
    byte* str;
    int32 len;
    };

    But now, https://golang.org/src/runtime/runtime.h has gone. I try to
    grep "string struct" in the golang source code,
    but can't find string definition.

    Where can I find string implementation now? Thanks in advance!
    Go has been re-written in Go starting with 1.5, so to say, in order to
    build Go >= 1.5 from sources you now need to have Go 1.4 or higher
    installed and working.

    Consequently, string manipulation has been re-written in Go as well
    and hence there's no more C's header files for that.

    I'd say the file you need is {src}/runtime/string.go assuming the {src}
    is the directory with the Go's source code.

    --
    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
postedMar 23, '16 at 3:52a
activeMar 23, '16 at 11:38a
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase