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

initial modules support #3

Merged
merged 1 commit into from
Aug 14, 2018
Merged
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: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/scylladb/go-set

require github.com/fatih/set v0.2.1
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not like it. It's only needed for the benchmark.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what happened when I followed the instructions in https://github.com/golang/go/wiki/Modules I don't really like it either...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can probably just remove it but I am not sure how it would work for a user running go test -bench ./... for example.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not really following vgo advancements maybe it's smart enough to figure it out (dep can do that).

Copy link

Choose a reason for hiding this comment

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

@mmatczuk @dahankzter

Go modules' go.mod does not distinguish between test dependencies and non-test dependencies. Hence, because github.com/fatih/set is a dependency of one or more of github.com/scylladb/go-set/... packages or their (external) tests, then it is added.

@mmatczuk do you have a concern about this dependency being included?

@dahankzter - any reason you're choosing to ignore go.sum?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's good, thanks @myitcv I will add it when the time comes for it. Is the file format frozen yet?

Copy link

Choose a reason for hiding this comment

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

Module support in Go 1.11 is still considered experimental, so never say never, but I would highly surprised if any changes were made that were backwards incompatible.

Choose a reason for hiding this comment

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

Just to support and expand slightly on that comment from @myitcv: the core go team has said the current file format understood by vgo and go 1.11 will be understood by future tooling... for example in this sentence at the end of the official Modules proposal document:

Even though the details may change, future releases will be able to consume Go 1.11-compatible source trees. For example, Go 1.12 will understand how to consume the Go 1.11 go.mod file syntax, even if by then the file syntax or even the file name has changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have rerun the procedure using the latest beta (3) and committed the go.sum file as well.

Choose a reason for hiding this comment

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

One other quick comment is that to make it clearer to your users at a glance as to why this dependency is there, you could add a manual comment in the go.mod file. Something like: // only imported when running benchmarks or however you would want to characterize it to help make it clear that it is not used outside of testing or benchmarks.

2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/fatih/set v0.2.1 h1:nn2CaJyknWE/6txyUDGwysr3G5QC6xWB/PtVjPBbeaA=
github.com/fatih/set v0.2.1/go.mod h1:+RKtMCH+favT2+3YecHGxcc0b4KyVWA1QWWJUs4E0CI=