Skip to content

Demo (shebang, documentation) #20

@strarsis

Description

@strarsis

I installed golang on Debian Jessie (Package golang) and tried to run the server demo,
using this command as described in the docs:

$ cd demo/server
$ ./server

It is not interpreted as go:

./server.go: line 1: //: Is a directory
./server.go: line 2: //: Is a directory
./server.go: line 3: //: Is a directory
[...]

The problem can be fixed by prepending a shebang for go to the go files
(from http://stackoverflow.com/questions/7707178/whats-the-appropriate-go-shebang-line):

//usr/bin/go run $0 $@ ; exit
[...]

chmod +x may be needed, too to make it executable:

$ chmod +x ./demo/server/server.go
$ chmod +x ./demo/wsclient/wsclient.go

Also some go packages have to be installed before the demos can be tried,
this may be useful being documented, too:

(enter the ./demo directory first)
$ export GOPATH=$(pwd)

# for the server or wsclient demo
$ go get golang.org/x/net/websocket
$ mkdir -p src/github.com/eBay/fabio/_third_party
$ mv src/golang.org/ src/github.com/eBay/fabio/_third_party/


# specifically for the server demo
$ go get github.com/hashicorp/go-cleanhttp

$ go get github.com/hashicorp/consul
$ go get github.com/hashicorp/consul/api
$ mkdir -p src/github.com/eBay/fabio/_third_party/github.com
$ mv src/github.com/hashicorp/consul/ src/github.com/eBay/fabio/_third_party/github.com/hashicorp/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions