Installation in windows 32 bit, Go 1.2 getting open NUL error

430 views
Skip to first unread message

kisho...@gmail.com

unread,
Feb 6, 2014, 1:08:36 AM2/6/14
to golan...@googlegroups.com
Hello all,

I'm trying to install Go 1.2 in my windows7(32bit,) machine. Installation was successful. i can execute go env.. But when i run go run hello.go.. 
It's throwing 
                                           "go build command-line-arguments: open NUL: The system cannot find the file specified. "

After googling and searching for solutions still this didn't get fixed.

This is my env 



here, hello.go contains basic hello world program with fmt package., go build fmt working fine.. but go run hello.go is not working.


Even i found some other people also facing same issue.

Can anyone help me to fix this.?

JussiJ

unread,
Feb 6, 2014, 7:55:21 AM2/6/14
to golan...@googlegroups.com


On Thursday, February 6, 2014 5:08:36 PM UTC+11, kishore bjv wrote:

From your pastebin link:
  1. C:\go>go run hello.go
  1. go build command-line-arguments: open NUL: The system cannot find the file speci
  2. fied.
Can anyone help me to fix this.?

So does the c:\go\hello.go file exists? 

Carlos Castillo

unread,
Feb 6, 2014, 9:49:32 AM2/6/14
to golan...@googlegroups.com
This is probably not your problem, but is still very important:

GOPATH should not be "C:\go\bin".

It should be a folder you are expected to write your go code in. It should belong to your user, and shouldn't be equal to or contained within GOROOT. 

brainman

unread,
Feb 6, 2014, 8:18:46 PM2/6/14
to golan...@googlegroups.com
On Thursday, 6 February 2014 17:08:36 UTC+11, kishore bjv wrote:

> ... Installation was successful. ...

Did you install binary installation or did you used source code installation? What is the directory where you installed Go? Is it possible that you have/had older version of Go on your computer? What does "echo %PATH%" command prints?

> ... go build fmt working fine ...

What does "go build fmt" do? I suspect nothing. Print output of "go build -x fmt" to see, if it does anything. And, if it does nothing, change some source file in fmt package (put some extra space somewhere), and try again? I think it will fail in a similar way.

It looks like your computer refuses to open file named "NUL". Is it possible? Perhaps you can use some other computer language to try and do that.

Thank you.

Alex
Message has been deleted

kishore bjv

unread,
Feb 7, 2014, 4:10:50 AM2/7/14
to golan...@googlegroups.com

Thanks alot guys @JUssiJ,@Carlos,@brainman for responding .

here you can see output http://pastebin.com/NgQB9AG6

@JUssiJ   

 Yeah file existing . and even i tried to run cmd as administrator.

@Carlos Castillo
        
       Actually, first time i gave GOPATH as my workspace(folder path in which my code is there). It also didn't work out. so later i changed to installation folder.(just for a try). It also didn't work. 

@brainman

Did you install binary installation or did you used source code installation? What is the directory where you installed Go? Is it possible that you have/had older version of Go on your computer? What does "echo %PATH%" command prints?
-> I tried in either ways, (installed binary & downloaded a zip file ) both methods results to same error. Go installed in "C:\Go".  I installed version 1.0 initially and then i uninstalled , deleted folder and this is version 1.2 insta
    lled. So finally this is binary that i installed for v1.2

 What does "go build fmt" do? I suspect nothing. Print output of "go build -x fmt" to see, if it does anything. And, if it does nothing, change some source file in fmt package (put some extra space somewhere), and try again? I think it will fail in a similar way.
-> Just to check whether go working or not.. i mean if at the time installation anything  went wrong. it should give me error if anything went wrong.


Thanks,
Kishore
 
 

Carlos Castillo

unread,
Feb 7, 2014, 7:04:44 AM2/7/14
to golan...@googlegroups.com
Now that we can see the setup, what is the command and output that you are seeing?

For example, what does go build -x hello.go do while in the Dir with hello.go?

Also look at http://golang.org/doc/code.html again for how you should eventually organize your code. Inside GOPATH, there should be a src dir, and inside that, each package should be in its own subdirectory. So your hello.go should be eventually at a location like E:\Kishore\Go\Code\src\hello\hello.go (you might want to make GOPATH E:\Kishore\Go, and store it at E:\Kishore\Go\src\hello\hello.go).

kishore bjv

unread,
Feb 10, 2014, 1:50:37 AM2/10/14
to golan...@googlegroups.com
@Carlos Castillo  : 
 As per my understanding creating src dir and all for organizing code .. It's not for executing code. 
How ever this is the error "go build command-line-arguments: open NUL: The system cannot find the file specified."

I want to know much about this error what is open NUL exactly stands for.






Dave Cheney

unread,
Feb 10, 2014, 1:57:34 AM2/10/14
to kishore bjv, golan...@googlegroups.com
NUL: is the windows version of /dev/null

Are you using any Cygwin components or an alternative shell to cmd.exe?

Have you tried turning your Virus checker off?
--
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.
For more options, visit https://groups.google.com/groups/opt_out.

kishore bjv

unread,
Feb 17, 2014, 4:45:16 AM2/17/14
to golan...@googlegroups.com, kishore bjv
@Dave, No I'm not using cygwin or anything other than cmd.exe .
I tried with running cmd.exe with "Run as administrator" option too.. and turned of my anti virus. but no use.

I tried running code LiteIDE(windows version of IDE for Golang).  it also giving same error.

c:/go/bin/go.exe build [E:/Kishore/Go/code]

go build _/E_/Kishore/Go/code: open NUL: The system cannot find the file specified.

Error: process exited with code 1.


 

Denis Portnov

unread,
Feb 18, 2014, 6:43:20 PM2/18/14
to golan...@googlegroups.com
check C:\Windows\System32\drivers\ (or whatever windows dir you have)
do you have null.sys in there?

Denis Portnov

unread,
Feb 19, 2014, 7:24:52 AM2/19/14
to golan...@googlegroups.com

Dave Cheney

unread,
Feb 19, 2014, 7:20:42 PM2/19/14
to golan...@googlegroups.com
You can disable /dev/null on Windows machines ? Who the heck thought up that footgun ?

On Wednesday, 19 February 2014 23:24:52 UTC+11, Denis Portnov wrote:

kisshore

unread,
Feb 19, 2014, 11:35:52 PM2/19/14
to Dave Cheney, golan...@googlegroups.com
@Denis Yeah, i checked that post. Null service is enabled. Everything goes fine with it.

@Dave First time I'm hearing this NULL


--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/gKymzJ8ZZQc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.

Matt Harden

unread,
Feb 20, 2014, 1:15:39 PM2/20/14
to Dave Cheney, golang-nuts
I think you realize it's pretty easy to disable it on UNIX too, as root: rm /dev/null.


--
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.
Reply all
Reply to author
Forward
0 new messages