FAQ
I'm really sorry for asking this rookie question. But I'm really confused.
I completed the "How to Write Go Code" Tutorial. Then I wanted to start
with another program. I tried to start with this pingpong example:
https://code.google.com/p/go/source/browse/2013/advconc/pingpong/pingpong.go?repo=talks&r=4eb3066a866f70b2f4f054bd88f9b23d03e03607

a "go install" command returns always this (for me strange) error: "can't
load package: ...: no buildable Go source files in"

What am I missing? If I copy the pingpong code into the playground it
works. If I update the "hello world" example from tutorial with the
pingpong example it fails too. I'm sorry I think this must have been
explained somewhere but after searching I could not find something helpful.

Thanks a lot!

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

  • Egon at Aug 16, 2015 at 7:13 pm

    On Sunday, 16 August 2015 22:04:49 UTC+3, christian...@googlemail.com wrote:
    I'm really sorry for asking this rookie question. But I'm really confused.
    I completed the "How to Write Go Code" Tutorial. Then I wanted to start
    with another program. I tried to start with this pingpong example:

    https://code.google.com/p/go/source/browse/2013/advconc/pingpong/pingpong.go?repo=talks&r=4eb3066a866f70b2f4f054bd88f9b23d03e03607

    a "go install" command returns always this (for me strange) error: "can't
    load package: ...: no buildable Go source files in"
    Remove "// +build OMIT".

    See "Build Constraints" section in http://golang.org/pkg/go/build/ for an
    explanation.

    tl;dr; build tags allow restricting what will be built when invoking `go
    install` with specific tags. "// +build OMIT" and "// +build ignore" is
    convention used to specify that the file shouldn't be included in the build
    result. You can still run the code with `go run pingpong.go`, which ignores
    the build tags. Playground also ignores them.

    What am I missing? If I copy the pingpong code into the playground it
    works. If I update the "hello world" example from tutorial with the
    pingpong example it fails too. I'm sorry I think this must have been
    explained somewhere but after searching I could not find something helpful.

    Thanks a lot!
    --
    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.
  • Christian Murschall at Aug 17, 2015 at 7:38 am
    Thanks a lot! That was exactly the problem.

    Christian

    On Sunday, 16 August 2015 21:13:43 UTC+2, Egon wrote:

    On Sunday, 16 August 2015 22:04:49 UTC+3, christian...@googlemail.com
    wrote:
    I'm really sorry for asking this rookie question. But I'm really
    confused. I completed the "How to Write Go Code" Tutorial. Then I wanted to
    start with another program. I tried to start with this pingpong example:

    https://code.google.com/p/go/source/browse/2013/advconc/pingpong/pingpong.go?repo=talks&r=4eb3066a866f70b2f4f054bd88f9b23d03e03607

    a "go install" command returns always this (for me strange) error: "can't
    load package: ...: no buildable Go source files in"
    Remove "// +build OMIT".

    See "Build Constraints" section in http://golang.org/pkg/go/build/ for an
    explanation.

    tl;dr; build tags allow restricting what will be built when invoking `go
    install` with specific tags. "// +build OMIT" and "// +build ignore" is
    convention used to specify that the file shouldn't be included in the build
    result. You can still run the code with `go run pingpong.go`, which ignores
    the build tags. Playground also ignores them.

    What am I missing? If I copy the pingpong code into the playground it
    works. If I update the "hello world" example from tutorial with the
    pingpong example it fails too. I'm sorry I think this must have been
    explained somewhere but after searching I could not find something helpful.

    Thanks a lot!
    --
    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
postedAug 16, '15 at 7:04p
activeAug 17, '15 at 7:38a
posts3
users2
websitegolang.org

2 users in discussion

Christian Murschall: 2 posts Egon: 1 post

People

Translate

site design / logo © 2022 Grokbase