How to specify a dependency on the latest commit in a Go module repository in go.mod?
Hello everyone! I've just started learning Go and modules, and I've run into this problem.
I have a project that uses an external library, for example `github.com/someuser/awesome-lib`. There's a recent commit in its repository with an important bug fix, but the author hasn't released a new tag (version) with this fix yet. In my `go.mod`, the dependency is currently specified like this:
```
require github.com/someuser/awesome-lib v1.2.3
```
I want my project to use exactly the version of the code that is in the latest commit on the `main` (or `master`) branch. I tried simply writing `v1.2.4` or `latest` — it doesn't work, Go complains that such a version doesn't exist.
Please tell me how to correctly specify in `go.mod` so that Go downloads and uses the code from a specific commit? Do I need to change anything in the
No answers yet.
Log in to leave an answer
Blogs