set GOOS=windows set GOARCH=386 set GOROOT=<put root of you tree here, mine is c:\go> set GOBIN=<put your GO binary direcory here, where 8g.exe and 8l.exe are, mine is c:\go\bin> set PATH=%PATH%;%GOBIN%
you should be able to execute 8g.exe/8l.exe to compile/link your programs.
I downloaded the zip file and followed the steps outlined in the readme file for method 1 -- "Method 1: Using the batch files". When running the "./all.bash" command the build proceeds successfully until the tests are run for the "net" pkg, at which point the the build hangs. If I run the "make test" command in the ".../pkg/net" directory, the build fails after outputting the following...
-- 74.125.224.20:80 -- Dial("tcp", "", "74.125.224.20:80") = , dial tcp 74.125.224.20:80: A co
nnection attempt failed because the connected party did not properly respond aft er a period of time, or established connection failed because connected host has
failed to respond.
This is followed by a whole bunch of other attempts using different IP addressing schemes that all fail with timeouts
The documentation and download that I got did not work. I created the batch file below to compile my programs using the Win32 binaries downloaded (saved as 'gogo.bat'). This or something similar should be included with the package. You should be able to find me (Bob Trower) easily enough if this is formatted incorrectly and you need an archive of this file. Cheers!
: gogo.bat : : gogo.bat -- Bob Trower Mon 05/16/2011 Ver. 0.00 : @echo off set GODEFAULTROOT=C:\go if "%1"=="" goto usage : if not "%1"=="-E" if not "%1"=="-e" goto gogo set GOLOCAL=False :gogo : if not "%GOLOCAL%"=="False" setlocal set GOOS=windows set GOARCH=386 if "%GOROOT%"=="" set GOROOT=%GODEFAULTROOT% set GOBIN=%GOROOT%\bin set PATH=%PATH%;%GOROOT%\bin : set GOSRCFILE=%1 set SRCFILEEXT=go set GOCOMPIL=%GOBIN%\8g.exe set GOLINKER=%GOBIN%\8l.exe %GOCOMPIL% -I %GOROOT%\pkg\windows_386 %GOSRCFILE%.%SRCFILEEXT% %GOLINKER% -L %GOROOT%\pkg\windows_386 -o %GOSRCFILE%.exe %GOSRCFILE%.8 if not "%GOLOCAL%"=="False" endlocal goto end :usage echo +----------------------------------------------------------+ echo gogo (Run the go compiler) Bob Trower Thu 01/28/2010 echo Version 0.00 echo Usage: gogo [-E] {SourceFileName?} echo Purpose: This command will call the set the appropriate echo environment variables and call the go compiler. echo The -E option causes the environment to be echo kept. Otherwise, it is reset to the state that echo existed prior to calling. echo Notes: Requires Win32 Go executable environment from echo here: echo http://code.google.com/p/go/wiki/WindowsPort echo set GOROOT to the root of the installation echo directory. Currently defaults to: if "%GOROOT%"=="" echo %GODEFAULTROOT% if not "%GOROOT%"=="" echo %GOROOT% echo +----------------------------------------------------------+ goto end :end
:*** gogo.bat ***
:
: gogo.bat -- Bob Trower Mon 05/16/2011 Ver. 0.00
:
@echo off
set GODEFAULTROOT=C:\go
if "%1"=="" goto usage
:
if not "%1"=="-E" if not "%1"=="-e" goto gogo
set GOLOCAL=False
:gogo
:
if not "%GOLOCAL%"=="False" setlocal
set GOOS=windows
set GOARCH=386
if "%GOROOT%"=="" set GOROOT=%GODEFAULTROOT%
set GOBIN=%GOROOT%\bin
set PATH=%PATH%;%GOROOT%\bin
:
set GOSRCFILE=%1
set SRCFILEEXT=go
set GOCOMPIL=%GOBIN%\8g.exe
set GOLINKER=%GOBIN%\8l.exe
%GOCOMPIL% -I %GOROOT%\pkg\windows_386 %GOSRCFILE%.%SRCFILEEXT%
%GOLINKER% -L %GOROOT%\pkg\windows_386 -o %GOSRCFILE%.exe %GOSRCFILE%.8
if not "%GOLOCAL%"=="False" endlocal
goto end
:usage
echo +----------------------------------------------------------+
echo gogo (Run the go compiler) Bob Trower Thu 01/28/2010
echo Version 0.00
echo Usage: gogo [-E] {SourceFileName}
echo Purpose: This command will call the set the appropriate
echo environment variables and call the go compiler.
echo The -E option causes the environment to be
echo kept. Otherwise, it is reset to the state that
echo existed prior to calling.
echo Notes: Requires Win32 Go executable environment from
echo here:
echo http://code.google.com/p/go/wiki/WindowsPort
echo set GOROOT to the root of the installation
echo directory. Currently defaults to:
if "%GOROOT%"=="" echo %GODEFAULTROOT%
if not "%GOROOT%"=="" echo %GOROOT%
echo +----------------------------------------------------------+
goto end
:end
Sigh. Mice and men ... For the record, you may use the above freely and if you need and explicit license, the license for the above 'gogo.bat' is (your choice of) any of the following:
Why the tutor of calling dll function is removed?
I need a "How to get started" document for the Windows install. Has anybody written such a thing. Something that lists explicit PATH entries, etc.
See recent post http://tinyurl.com/4hup33m on golang-nuts group. Specificaly, it refers to https://bitbucket.org/akavel/gowin-env, that includes couple of batch files to set your way around. But, generally, if you set these variables:
set GOOS=windows set GOARCH=386 set GOROOT=<put root of you tree here, mine is c:\go> set GOBIN=<put your GO binary direcory here, where 8g.exe and 8l.exe are, mine is c:\go\bin> set PATH=%PATH%;%GOBIN%
you should be able to execute 8g.exe/8l.exe to compile/link your programs.
I downloaded the zip file and followed the steps outlined in the readme file for method 1 -- "Method 1: Using the batch files". When running the "./all.bash" command the build proceeds successfully until the tests are run for the "net" pkg, at which point the the build hangs. If I run the "make test" command in the ".../pkg/net" directory, the build fails after outputting the following...
--- FAIL: net.TestDialGoogle??
nnection attempt failed because the connected party did not properly respond aft er a period of time, or established connection failed because connected host has
This is followed by a whole bunch of other attempts using different IP addressing schemes that all fail with timeouts
RE: pkg/net test fails -- If I copy the address into a browser, it accesses the google home page successfully.
I think, you'll get some help if you post your question on http://groups.google.com/group/golang-nuts.
The documentation and download that I got did not work. I created the batch file below to compile my programs using the Win32 binaries downloaded (saved as 'gogo.bat'). This or something similar should be included with the package. You should be able to find me (Bob Trower) easily enough if this is formatted incorrectly and you need an archive of this file. Cheers!
: gogo.bat : : gogo.bat -- Bob Trower Mon 05/16/2011 Ver. 0.00 : @echo off set GODEFAULTROOT=C:\go if "%1"=="" goto usage : if not "%1"=="-E" if not "%1"=="-e" goto gogo set GOLOCAL=False :gogo : if not "%GOLOCAL%"=="False" setlocal set GOOS=windows set GOARCH=386 if "%GOROOT%"=="" set GOROOT=%GODEFAULTROOT% set GOBIN=%GOROOT%\bin set PATH=%PATH%;%GOROOT%\bin : set GOSRCFILE=%1 set SRCFILEEXT=go set GOCOMPIL=%GOBIN%\8g.exe set GOLINKER=%GOBIN%\8l.exe %GOCOMPIL% -I %GOROOT%\pkg\windows_386 %GOSRCFILE%.%SRCFILEEXT% %GOLINKER% -L %GOROOT%\pkg\windows_386 -o %GOSRCFILE%.exe %GOSRCFILE%.8 if not "%GOLOCAL%"=="False" endlocal goto end :usage echo +----------------------------------------------------------+ echo gogo (Run the go compiler) Bob Trower Thu 01/28/2010 echo Version 0.00 echo Usage: gogo [-E] {SourceFileName?} echo Purpose: This command will call the set the appropriate echo environment variables and call the go compiler. echo The -E option causes the environment to be echo kept. Otherwise, it is reset to the state that echo existed prior to calling. echo Notes: Requires Win32 Go executable environment from echo here: echo http://code.google.com/p/go/wiki/WindowsPort echo set GOROOT to the root of the installation echo directory. Currently defaults to: if "%GOROOT%"=="" echo %GODEFAULTROOT% if not "%GOROOT%"=="" echo %GOROOT% echo +----------------------------------------------------------+ goto end :end
Oops. Here's another try:
:*** gogo.bat *** : : gogo.bat -- Bob Trower Mon 05/16/2011 Ver. 0.00 : @echo off set GODEFAULTROOT=C:\go if "%1"=="" goto usage : if not "%1"=="-E" if not "%1"=="-e" goto gogo set GOLOCAL=False :gogo : if not "%GOLOCAL%"=="False" setlocal set GOOS=windows set GOARCH=386 if "%GOROOT%"=="" set GOROOT=%GODEFAULTROOT% set GOBIN=%GOROOT%\bin set PATH=%PATH%;%GOROOT%\bin : set GOSRCFILE=%1 set SRCFILEEXT=go set GOCOMPIL=%GOBIN%\8g.exe set GOLINKER=%GOBIN%\8l.exe %GOCOMPIL% -I %GOROOT%\pkg\windows_386 %GOSRCFILE%.%SRCFILEEXT% %GOLINKER% -L %GOROOT%\pkg\windows_386 -o %GOSRCFILE%.exe %GOSRCFILE%.8 if not "%GOLOCAL%"=="False" endlocal goto end :usage echo +----------------------------------------------------------+ echo gogo (Run the go compiler) Bob Trower Thu 01/28/2010 echo Version 0.00 echo Usage: gogo [-E] {SourceFileName} echo Purpose: This command will call the set the appropriate echo environment variables and call the go compiler. echo The -E option causes the environment to be echo kept. Otherwise, it is reset to the state that echo existed prior to calling. echo Notes: Requires Win32 Go executable environment from echo here: echo http://code.google.com/p/go/wiki/WindowsPort echo set GOROOT to the root of the installation echo directory. Currently defaults to: if "%GOROOT%"=="" echo %GODEFAULTROOT% if not "%GOROOT%"=="" echo %GOROOT% echo +----------------------------------------------------------+ goto end :endSigh. Mice and men ... For the record, you may use the above freely and if you need and explicit license, the license for the above 'gogo.bat' is (your choice of) any of the following:
The license for the rest of the go package The BSD license as found here: http://base64.sourceforge.net/b64.c GPL 2 or GPL 3
Contact me if you need clarification or another license.