Comments (14)
try :
go-lang (1.2) Go is an open source programming language that makes it easy to build simple,
reliable, and efficient software.
parts install go-lang
from boxparts.
I installed successfully, but how could I set GOPATH and where point to?
I need a golang template when I create a project in Codio.
from boxparts.
If you send us a template, we'll use that as a start and add it to templates. We are not really experienced Go users, so if you tell us what you want, we'll do our best to add it quickly.
@MaximKraev can you help with the GOPATH question?
from boxparts.
I don't know the template of Codio. If the Codio box base the Docker, it's just a Docker within Golang like https://index.docker.io/u/mischief/docker-golang.
from boxparts.
@genedna is now clear what you mean by template. @MaximKraev can we set it up as suggested by @genedna ?
from boxparts.
our docker container don't have golang preinstalled, parts packages are installed into a user home directory, go lang is located in ~/.parts/packages/go-lang/1.2/
please also do not forget to close and open a terminal, it is the small notice after install. I will work to make it more visible
codio@6d719e70fb09:~/workspace$ parts install go-lang
=> Downloading http://parts.codio.com/box-codio-v1/go-lang-1.2-binary.tar.gz...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 41 100 41 0 0 2163 0 --:--:-- --:--:-- --:--:-- 2733
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 53.5M 100 53.5M 0 0 45.6M 0 0:00:01 0:00:01 --:--:-- 45.7M
=> Extracting archive...
=> Installing...
=> Symlinking...
=> Installed go-lang 1.2
Close and open terminal to have go-lang working after the install.
codio@6d719e70fb09:~/workspace$
codio@6d719e70fb09:~/workspace$ go
Go is a tool for managing Go source code.
Usage:
go command [arguments]
The commands are:
build compile packages and dependencies
clean remove object files
env print Go environment information
fix run go tool fix on packages
fmt run gofmt on package sources
get download and install packages and dependencies
install compile and install packages and dependencies
list list packages
run compile and run Go program
test test packages
tool run specified go tool
version print Go version
vet run go tool vet on packages
Use "go help [command]" for more information about a command.
Additional help topics:
c calling between Go and C
gopath GOPATH environment variable
importpath import path syntax
packages description of package lists
testflag description of testing flags
testfunc description of testing functions
Use "go help [topic]" for more information about that topic.
codio@6d719e70fb09:~/workspace$ go run test.go
Hello, 世界
codio@6d719e70fb09:~/workspace$ cat test.go
// You can edit this code!
// Click here and start typing.
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}codio@6d719e70fb09:~/workspace$
from boxparts.
@genedna if you are all ok with this, I will close the issue out.
from boxparts.
@MaximKraev When you get the 3rd package, you will got
codio@369c78af72c4:~/workspace$ go get github.com/elazarl/goproxy
package github.com/elazarl/goproxy: cannot download, $GOPATH not set. For more details see: go help gopath
If I set $GOPATH, I write it to .profile or .bash_profile ?
from boxparts.
ok, now I understand the issue, it is fixed
do
parts uninstall go-lang
parts update
parts install go-lang
and restart terminal
from boxparts.
@MaximKraev I think this doesn't solve the issue.
The GOPATH must have a certain directory structure, as explained here: http://golang.org/doc/code.html#Workspaces
I tried installing go, and my environment now is like this:
codio@mowana-barful:~/workspace$ echo $GOPATH
/home/codio/.parts/packages/go-lang/1.2/gopath
codio@mowana-barful:~/workspace$ go get
go install: no install location for directory /home/codio/workspace outside GOPATH
For go to work property, the project in my case, should be in a folder like this:
~/workspace/src/github.com/fabioxgn/go-bot
And the GOPATH should point to the ~/workspace, which must have the src folder.
So the structure should be:
$GOPATH/src/site/user/repository
from boxparts.
Were you able to get this working @fabioxgn ?
I installed go-lang and run into the same problems as you.
I set $GOPATH to ~/workspace/src/github.com/mikeroosa/hello from the command line but the command 'go install' gives me the GOPATH error as well.
from boxparts.
@mikeroosa to be honest didn't tried again. Will try it when I have the chance.
from boxparts.
@fabioxgn Actually, I did get it working temporarily. I typed this at the terminal
export GOPATH=~/workspace
How do I add that so it stays when I close the terminal and re-open?
from boxparts.
@mikeroosa To persist the GOPATH you just have to add it to ~/.bash_profile
I configured a new box from scratch and it worked great.
Step by step what I did was:
- Create a new empty project
- Execute on the terminal: parts install go-lang
- Edited ~/.bash_profile and added: export GOPATH="$HOME/workspace"
- Restarted terminal and go get, go build, etc are all working
from boxparts.
Related Issues (20)
- Box part for a command line ftp client HOT 2
- Guppy box part HOT 1
- Problem installing guppy part with pip HOT 2
- Add Qt5-sdk box part
- Add gdb box part HOT 6
- Add Uncrustify
- Request for Minium HOT 2
- Add postgis extension for postgresql HOT 2
- Request for fis-gtm
- GraphicsMagick on Ubunutu
- Connector/C (libmysqlclient) is a client library for C development.
- libyaml HOT 1
- Request new boxpart for RethinkDB 2.0.1 HOT 1
- Two certified Python starter packs fail: python3 and/or xserver box part doesn't include libtk8.5 HOT 2
- Optional Command Line Parameters HOT 4
- Go-lang 1.5.1? HOT 1
- node v0.10.40 HOT 1
- Swift support HOT 2
- cairo HOT 1
- shutting down with code:100 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boxparts.