FAQ
Hi. I have problem with run go run command from windows CMD.

Standard dev command
go run *.go
generate error
GetFileAttributesEx *.go: winapi error #123
At this moment on windows i must use alternative console (for example
MINGW32) for normal workflow, but as I know - many new developers had this
problem, and nowhere in google any info about this.

(windows 7, x64)

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

  • Minux at Jan 30, 2013 at 4:44 pm

    On Thu, Jan 31, 2013 at 12:15 AM, Dawid Polak wrote:

    Hi. I have problem with run go run command from windows CMD.

    Standard dev command
    go run *.go
    "go run" doesn't support expanding '*', so you will have to expand *.go to
    a list of go filenames.

    This is not a problem of Go itself, as Windows cmd doesn't expand the
    wildcard.

    btw, if you're using more than one file for the main package, why not follow
    http://golang.org/doc/code.html and set up GOPATH and use go build/install?
    generate error
    GetFileAttributesEx *.go: winapi error #123
    At this moment on windows i must use alternative console (for example
    MINGW32) for normal workflow, but as I know - many new developers had this
    problem, and nowhere in google any info about this.
    we don't require alternative console on windows.
    (windows 7, x64)
    --
    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.
  • Dawid Polak at Jan 30, 2013 at 5:31 pm
    This is not a problem of Go itself, as Windows cmd doesn't expand the
    wildcard.
    I know. But documentation should mention more abut this limitation.
    btw, if you're using more than one file for the main package, why not follow
    http://golang.org/doc/code.html and set up GOPATH and use go
    build/install?

    Of course - i have - but many times go run is used for test run only, and
    simple - is faster.
    we don't require alternative console on windows.
    But maybe documentation should suggest this solution, or in 'go run'
    implement alternative command line parameter format - for example " go run
    ' *.go ' "

    --
    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.
  • Minux at Jan 30, 2013 at 5:40 pm

    On Thu, Jan 31, 2013 at 1:26 AM, Dawid Polak wrote:

    This is not a problem of Go itself, as Windows cmd doesn't expand the
    wildcard.
    I know. But documentation should mention more abut this limitation.
    btw, if you're using more than one file for the main package, why not follow
    http://golang.org/doc/code.**html <http://golang.org/doc/code.html> and
    set up GOPATH and use go build/install?

    Of course - i have - but many times go run is used for test run only, and
    simple - is faster.
    it is only faster if you only run the same set of program once.
    probably you can create a script (or better, a Go program) to wrap the go
    tool and
    expand wildcards in the argument (use path/filepath.Glob and os/exec for
    that task)
    we don't require alternative console on windows.
    But maybe documentation should suggest this solution, or in 'go run'
    implement alternative command line parameter format - for example " go run
    ' *.go ' "
    "go run" is only supposed to run single file commands for test purpose, so
    it even
    don't support read the source code from stdin, because the authors' fear
    that people
    will abuse that (however, as i frequently run sample programs from
    play.golang.org,
    i do have a script for that).

    --
    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.
  • Mattn at Feb 13, 2013 at 11:53 am
    it is only faster if you only run the same set of program once.
    probably you can create a script (or better, a Go program) to wrap the go
    tool and
    expand wildcards in the argument (use path/filepath.Glob and os/exec for
    that task)
    Mingw32 uses __getmainargs in msvcrt.dll. So go can do it same. :)

    http://play.golang.org/p/SYbK-MSVSN

    --
    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.
  • Dataf5l at Jun 14, 2016 at 10:18 pm
    I was also bit in the ass by this, would you guys please fix it?

    On Wednesday, January 30, 2013 at 11:15:47 AM UTC-5, Dawid Polak wrote:

    Hi. I have problem with run go run command from windows CMD.

    Standard dev command
    go run *.go
    generate error
    GetFileAttributesEx *.go: winapi error #123
    At this moment on windows i must use alternative console (for example
    MINGW32) for normal workflow, but as I know - many new developers had this
    problem, and nowhere in google any info about this.

    (windows 7, x64)
    --
    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.
  • Dave Cheney at Jun 14, 2016 at 11:08 pm
    I think you're expecting too much from go run. Please see Minix's comments from 2013, go run is just for short throw away examples. For anything more important, structure your code in packages inside GOPATH.

    --
    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.
  • As Utf8 at Jun 15, 2016 at 2:25 am
    How exactly do you propose this be fixed? Windows has a crippled shell that thinks programs should process and interpret their own asterisk characters. This turns into a major inconsistency across windows CLI tools. I dont think Go should tailor itself to badly designed plumbing.

    --
    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
postedJan 30, '13 at 4:16p
activeJun 15, '16 at 2:25a
posts8
users6
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase