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

Migrate project to (only) Go modules #12

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ script:
- GOOS=linux GOARCH=amd64 go build -ldflags="-X 'github.com/sonatype-nexus-community/nancy/buildversion.BuildVersion=$VERSION' -X 'github.com/sonatype-nexus-community/nancy/buildversion.BuildTime=$time' -X 'github.com/sonatype-nexus-community/nancy/buildversion.BuildCommit=$TRAVIS_COMMIT'" -o nancy-linux.amd64-$VERSION
- GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'github.com/sonatype-nexus-community/nancy/buildversion.BuildVersion=$VERSION' -X 'github.com/sonatype-nexus-community/nancy/buildversion.BuildTime=$time' -X 'github.com/sonatype-nexus-community/nancy/buildversion.BuildCommit=$TRAVIS_COMMIT'" -o nancy-darwin.amd64-$VERSION
- GOOS=windows GOARCH=amd64 go build -ldflags="-X 'github.com/sonatype-nexus-community/nancy/buildversion.BuildVersion=$VERSION' -X 'github.com/sonatype-nexus-community/nancy/buildversion.BuildTime=$time' -X 'github.com/sonatype-nexus-community/nancy/buildversion.BuildCommit=$TRAVIS_COMMIT'" -o nancy-windows.amd64-$VERSION.exe
- ./nancy-linux.amd64-$VERSION Gopkg.lock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should still stick around as we still support dep from a nancy standpoint and this is effectively an "integration test". Maybe just move that file into a directory and point this to it.

- ./nancy-linux.amd64-$VERSION go.sum
env:
- GO111MODULE=on
Expand All @@ -24,7 +23,7 @@ deploy:
provider: releases
api_key:
secure: ikkwLQWekiGiAuz4Pcstec3WeklFh7qf+abf8F11BVHMcLGrdTfqDAJQ5l45KNZeaLedsj4bK6ILk99Y6VGqHIJulGpVdzQLx7F+sOPuEpZ02DBaMT0Ku/jV8Mj7C6etFQhy+HrK7hrHNKXAmR6RgdI12cp5igQMEhmNR5WeNXtnVp8+9B/No8wfdfP1EmetHtnhLgF0p62KLwAUhgXHRioptfj1eMGjIMxF7MoIclQdFYieptTJx/+HdQCMKmD3O5F4lszZa65S5FxMfOBo31M+yE/+/8CXk2wvrBoprGBTGcKwQB58ZafqQY3LVp0ahFWcaVxJcRbRFdw3K4ccU8YSjnX1dfLlfEyyPklHm0YT7yPeAb0vWppliT+zXngcuknImHKVBkfYWCgutYAuEzMKqc8ZQMz5d2Sp64k7+Z23KXSYLKiN0S1Ckv9/5pQ8naa9eED87VEfnSitjCFjEQaGx7zVt4M1raZx8g0/cs+ZMjQpYNsChYFkj6Tt4Es/m1FT5jX5/GFame+7B4RPX13cWqck6FAWvwbkcdog8dddASEtyo6QHujopmPnQefNs6hrO+biKeWLewbTqG8LMd10INifiVm2Y9HZVi+vKTiVQPg7+pz/6LWU9oexnJjzRgMN7CTI6L+ffr8/gdvTXoKlev3ASh56muzPjGsbsZw=
file:
file:
- nancy-linux.amd64-$VERSION
- nancy-darwin.amd64-$VERSION
- nancy-windows.amd64-$VERSION.exe
Expand Down
128 changes: 0 additions & 128 deletions Gopkg.lock

This file was deleted.

47 changes: 0 additions & 47 deletions Gopkg.toml

This file was deleted.

36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can see an example of using `nancy` in Travis-CI at [this intentionally vuln
### DISCLAIMER

A portion of the golang ecosystem doesn't use proper versions, and instead uses a commit hash to resolve your dependency. Dependencies like this will not work with
`nancy` quite yet, as we don't have a mechanism on OSS Index to lookup vulnerabilities in that manner.
`nancy` quite yet, as we don't have a mechanism on OSS Index to lookup vulnerabilities in that manner.

## Why Nancy?

Expand All @@ -38,19 +38,16 @@ At current time you have a few options:

### Build from source

* Run `go get -u github.com/sonatype-nexus-community/nancy`
* Nancy should now be available wherever your GOPATH is set
* Run `dep ensure` in the root of the project
* In the root of the project `go test ./...`
* If tests checkout go ahead and run `go build`.
* Use that binary where ever your heart so desires!

For the adventurous, we have `go.mod` files that enable you to build using [go modules](https://github.com/golang/go/wiki/Modules).
`nancy` is built with Go 1.11 and supports Go modules. The easiest way to get started is to clone Nancy into a directory outside of the `$GOPATH`.
For example:

```
$ export GO111MODULE=on
$ go test ./...
$ go build
mkdir $HOME/code
cd $HOME/code
git clone https://github.com/sonatype-nexus-community/nancy.git
cd nancy
go install

```

### Download release binary
Expand All @@ -61,11 +58,18 @@ Each commit to master creates a new release binary, and if you'd like to skip bu

## Development

`nancy` is written using Golang 1.11, so it is best you start there.
`nancy` is built with Go 1.11 and supports Go modules. The easiest way to get started is to clone Nancy into a directory outside of the `$GOPATH`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and Build from source are basically identical do we really need both??

For example:

This project also uses `dep` for dependencies, so you will need to download `dep`.
```
mkdir $HOME/code
cd $HOME/code
git clone https://github.com/sonatype-nexus-community/nancy.git
cd nancy
go test ./... -v
go build

Tests can be run like `go test ./... -v`
```

## Contributing

Expand All @@ -75,7 +79,7 @@ a new issue, or comment on an existing issue, to let others know you are!

## Acknowledgements

The `nancy` logo was created using a combo of [Gopherize.me](https://gopherize.me/) and good ole Photoshop. Thanks to the creators of
The `nancy` logo was created using a combo of [Gopherize.me](https://gopherize.me/) and good ole Photoshop. Thanks to the creators of
Gopherize for an easy way to make a fun Gopher :)

Original Gopher designed by Renee French.
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ github.com/dgraph-io/badger v1.5.5-0.20181004181505-439fd464b155 h1:T4boC9W0W8nX
github.com/dgraph-io/badger v1.5.5-0.20181004181505-439fd464b155/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ=
github.com/dgryski/go-farm v0.0.0-20180109070241-2de33835d102 h1:afESQBXJEnj3fu+34X//E8Wg3nEbMJxJkwSc0tPePK0=
github.com/dgryski/go-farm v0.0.0-20180109070241-2de33835d102/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand All @@ -25,7 +24,6 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb h1:pf3XwC90UUdNPYWZdFjhGBE7DUFuK3Ct1zWmZ65QN30=
golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func main() {

path = args[len(args)-1]

// Currently only checks Dep, can eventually check for go mod, etc...
doCheckExistenceAndParse()
}

Expand Down