FAQ
I am sure I am probably missing something pretty simple but I can't figure
it out. I am using Go 1.1.2 on Windows 7 X64 and I can compile a file "go
build main.go" without any problems. However, if I run the command "go
tool 6g main.go", I get errors: can't find import: "xxxx"

Why would a "go build" work but "go tool 6g" throw an error?

Luke

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

  • Dmitry Vyukov at Aug 20, 2013 at 7:26 pm

    On Tue, Aug 20, 2013 at 11:19 PM, Luke Mauldin wrote:
    I am sure I am probably missing something pretty simple but I can't figure
    it out. I am using Go 1.1.2 on Windows 7 X64 and I can compile a file "go
    build main.go" without any problems. However, if I run the command "go tool
    6g main.go", I get errors: can't find import: "xxxx"

    Why would a "go build" work but "go tool 6g" throw an error?

    you need to pass additional flags to compiler
    run go build -v -x -work
    and it will show you the commands it executes, in particular flags to compiler

    --
    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.
  • Luke Mauldin at Aug 20, 2013 at 7:39 pm
    Thank you, that works great.
    When running "go build", is there a way to pass specific parameters to the
    compiler and/or linker? I attempted running "go build -gcflags '-m'" but I
    didn't see any of the optimization decisions on the console.

    Luke
    On Tuesday, August 20, 2013 2:26:15 PM UTC-5, Dmitry Vyukov wrote:
    On Tue, Aug 20, 2013 at 11:19 PM, Luke Mauldin wrote:
    I am sure I am probably missing something pretty simple but I can't figure
    it out. I am using Go 1.1.2 on Windows 7 X64 and I can compile a file "go
    build main.go" without any problems. However, if I run the command "go tool
    6g main.go", I get errors: can't find import: "xxxx"

    Why would a "go build" work but "go tool 6g" throw an error?

    you need to pass additional flags to compiler
    run go build -v -x -work
    and it will show you the commands it executes, in particular flags to
    compiler
    --
    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.
  • Dmitry Vyukov at Aug 20, 2013 at 7:47 pm
    try adding -a, it will force rebuild

    go build -gcflags=-m -a math
    works for me
    On Tue, Aug 20, 2013 at 11:39 PM, Luke Mauldin wrote:
    Thank you, that works great.
    When running "go build", is there a way to pass specific parameters to the
    compiler and/or linker? I attempted running "go build -gcflags '-m'" but I
    didn't see any of the optimization decisions on the console.

    Luke
    On Tuesday, August 20, 2013 2:26:15 PM UTC-5, Dmitry Vyukov wrote:
    On Tue, Aug 20, 2013 at 11:19 PM, Luke Mauldin wrote:
    I am sure I am probably missing something pretty simple but I can't
    figure
    it out. I am using Go 1.1.2 on Windows 7 X64 and I can compile a file
    "go
    build main.go" without any problems. However, if I run the command "go
    tool
    6g main.go", I get errors: can't find import: "xxxx"

    Why would a "go build" work but "go tool 6g" throw an error?

    you need to pass additional flags to compiler
    run go build -v -x -work
    and it will show you the commands it executes, in particular flags to
    compiler
    --
    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.
  • Luke Mauldin at Aug 20, 2013 at 7:59 pm
    That works. Thank you.
    On Tuesday, August 20, 2013 2:46:46 PM UTC-5, Dmitry Vyukov wrote:

    try adding -a, it will force rebuild

    go build -gcflags=-m -a math
    works for me
    On Tue, Aug 20, 2013 at 11:39 PM, Luke Mauldin wrote:
    Thank you, that works great.
    When running "go build", is there a way to pass specific parameters to the
    compiler and/or linker? I attempted running "go build -gcflags '-m'" but I
    didn't see any of the optimization decisions on the console.

    Luke
    On Tuesday, August 20, 2013 2:26:15 PM UTC-5, Dmitry Vyukov wrote:
    On Tue, Aug 20, 2013 at 11:19 PM, Luke Mauldin wrote:
    I am sure I am probably missing something pretty simple but I can't
    figure
    it out. I am using Go 1.1.2 on Windows 7 X64 and I can compile a
    file
    "go
    build main.go" without any problems. However, if I run the command
    "go
    tool
    6g main.go", I get errors: can't find import: "xxxx"

    Why would a "go build" work but "go tool 6g" throw an error?

    you need to pass additional flags to compiler
    run go build -v -x -work
    and it will show you the commands it executes, in particular flags to
    compiler
    --
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedAug 20, '13 at 7:19p
activeAug 20, '13 at 7:59p
posts5
users2
websitegolang.org

2 users in discussion

Luke Mauldin: 3 posts Dmitry Vyukov: 2 posts

People

Translate

site design / logo © 2022 Grokbase