Friday, March 13, 2015

Go incursion on Windows - powershell

Today moved on Windows with the project and tried to address same folder limitation for go build (no luck: named files must all be in one directory; have blabla\ and blabla\someotherblabla\ )
$allGoFilesForBuildStringBuilder = New-Object -TypeName "System.Text.StringBuilder"
Get-ChildItem . -recurse | where { $_.extension -eq ".go" } | ForEach { $allGoFilesForBuildStringBuilder.Append('"').Append($_.FullName).Append('" ') } 
go build $allGoFilesForBuildStringBuilder.ToString()
Reminder: If you are stuck on GOROOT_BOOTSTRAP error, check that this env variable hints to a go folder having all the binaries in the bin subfolder.
[Environment]::SetEnvironmentVariable("GOROOT_BOOTSTRAP", "Go_Folder", "User")
[Environment]::GetEnvironmentVariable("GOROOT_BOOTSTRAP","User")
Use "Machine" instead of "User" for system wide configuration

2 comments:

jowdjbrown said...

nice and having what a fine information, which is quite a good things. and having nice information. zonefit.ro

jowdjbrown said...

I like your post. It is good to see you verbalize from the heart and clarity on this important subject can be easily observed. more info view site hairmastic