Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move example applications each to their own package/dir #164

Closed
sslavic opened this issue Jan 13, 2018 · 0 comments · Fixed by #166
Closed

Move example applications each to their own package/dir #164

sslavic opened this issue Jan 13, 2018 · 0 comments · Fixed by #166
Assignees

Comments

@sslavic
Copy link

sslavic commented Jan 13, 2018

Please have example applications each moved to their own package/dir so they can be go installed with GOPATH being set but without GOBIN being set.

E.g. after move following should pass:

$ docker run -it --rm --name test golang:1 bash
$ go get github.com/nats-io/go-nats-streaming
$ go install github.com/nats-io/go-nats-streaming/examples/stan-pub

where stan-pub is a directory with only main.go or stan-pub.go of stan-pub example application.

Currently following:

$ docker run -it --rm --name test golang:1 bash
$ go get github.com/nats-io/go-nats-streaming
$ go install github.com/nats-io/go-nats-streaming/examples

installs stan-bench only as /go/bin/examples binary.

Also, currently following:

$ docker run -it --rm --name test golang:1 bash
$ go get github.com/nats-io/go-nats-streaming
$ go install /go/src/github.com/nats-io/go-nats-streaming/examples/stan-pub.go

fails with

go install: no install location for .go files listed on command line (GOBIN not set)

because golang Docker images set only GOPATH but not GOBIN, and there is inconsistency in go install behaviour/requirements when package and when .go file is being used - in former GOBIN is not required while in latter GOBIN is being required.

Related:

kozlovic pushed a commit that referenced this issue Jan 15, 2018
Each example has been moved to its own directory (and .go file changed
to main.go, and build directive removed).
With this change, once you `go get` the library, you can intall
all examples with the following command:

```
go install github.com/nats-io/go-nats-streaming/examples/*
```

Also fixed some issues reported by megacheck.

Resolves #164
kozlovic pushed a commit that referenced this issue Jan 15, 2018
Each example has been moved to its own directory (and .go file changed
to main.go, and build directive removed).
With this change, once you `go get` the library, you can intall
all examples with the following command:

```
go install github.com/nats-io/go-nats-streaming/examples/*
```

Also fixed some issues reported by megacheck.

Resolves #164
kozlovic added a commit that referenced this issue Jan 15, 2018
Each example has been moved to its own directory (and .go file changed
to main.go, and build directive removed).
With this change, once you `go get` the library, you can intall
all examples with the following command:

```
go install github.com/nats-io/go-nats-streaming/examples/*
```

Also fixed some issues reported by megacheck.

Resolves #164
@ghost ghost added the waffle:needs review label Jan 15, 2018
@ghost ghost removed the waffle:needs review label Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants