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

Adding vendoring via dep, and updated README.md #1

Merged
merged 3 commits into from
Aug 24, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
crypto11.test
demo/*.pem
demo/demo
/.idea/
/vendor/
21 changes: 21 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"


[[constraint]]
branch = "master"
name = "github.com/miekg/pkcs11"

[[constraint]]
branch = "master"
name = "github.com/thalesignite/crypto11"
Copy link
Contributor

Choose a reason for hiding this comment

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

The last constraint here seems a strange - it is declaring a dependency on ourselves.
Is there a reason for that or was a result of dep init making a bad guess?

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it!

dep init doesn't want to write a Gopkg.toml that lists the repo itself. But it seems that it does a case-insensitive comparison. So if you clone github.com/ThalesIgnite/crypto11, it doesn't notice that the demo's import github.com/thalesignite/crypto11 is actually the same thing.

Per https://blog.golang.org/package-names Go package names are lower case, so I think the answer is we need to stop with the camelcase in ThalesIgnite. I'll adjust the README.md accordingly, and fix up the .toml files.

13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ Installation

(If you don't have one already) create [a standard Go workspace](https://golang.org/doc/code.html#Workspaces) and set the `GOPATH` environment variable to point to the workspace root.

Clone and build the PKCS#11 API wrapper:
crypto11 manages it's dependencies via `dep`. To Install `dep` run:

cd $GOPATH/src
git clone https://github.com/miekg/pkcs11 github.com/miekg/pkcs11
go install github.com/miekg/pkcs11
go get -u github.com/golang/dep/cmd/dep

Clone and build Crypto11:
Clone, ensure deps, and build:

git clone [email protected]:ThalesIgnite/crypto11.git github.com/ThalesIgnite/crypto11
cd github.com/ThalesIgnite/crypto11
go get github.com/ThalesIgnite/crypto11
cd $GOPATH/sr/github.com/ThalesIgnite/crypto11
Copy link
Contributor

@optnfast optnfast Aug 23, 2017

Choose a reason for hiding this comment

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

Typo: sr should be src.

dep ensure
go build

Edit `config` to taste, and then run the test program:
Expand Down