privacy statement. Hi @carlca, also, looking at this more, it seems github.com/dave/wasmgo is a command/binary? Should be more like "no package in current directory", and probably the substring "go get ." I navigated to the aforementioned ~/code/go/pkg/mod/github.com/dave/wasmgo@v0.0.0-20180816095012-16077efc512b folder and ran go mod init github.com/dave/wasmgo. your coworkers to find and share information. We use essential cookies to perform essential website functions, e.g. Learn more, We use analytics cookies to understand how you use our websites so we can make them better, e.g. is the only argument, 2) the working directory is the same as the module root directory, and 3) -u or -u=patch is set, we could print a hint after the error message: @jayconrod Thank you for your polite reply . We’ll occasionally send you account related emails. One comment is that when you are running a command like go get in module-aware mode, the resulting behavior still depends which module you are currently "in" as the current module, which means it depends on where you are in your filesystem hierarchy when you execute the go get command (given part of a module's definition is based on the location of the go.mod file in the filesystem hierarchy). My question, then, is: if one uses GO111MODULE=auto does one get the semantic versioning benefits of Go Modules? @abemotion That doesn't seem much clearer than the current message. This seems to imply, to me, that running go get -u in the root of module with no package in that root How can I secure MySQL against bruteforce attacks? Learn more, cmd/go: bad error from "go get" (with no arguments). Am I going to be handicapped for attempting to study theory with a monophonic instrument? How do I use a vendored argument to a function in an external package? does not name a module. Telling my supervisor about my medical condition, Creating an A record and then a CNAME to point a subdomain to a different server gives an error message, Counterpart to Confidante: Word for Someone Crying out for Help, how to append public keys to remote host instead of copy it. If an argument names a module but not a package (because there is no A module is a collection of Go packages stored in a directory with a go.mod file at its root. site design / logo © 2020 Stack Exchange Inc; user contributions licensed under cc by-sa. Have a question about this project? Presumably we wouldn't if we set GO111MODULE=off, but then that would defeat the whole object of the exercise. We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products. You can always update your selection by clicking Cookie Preferences at the bottom of the page. for each of the modules (project/game/entity, project/game, project/server), I did a git mod init. The go.mod file defines the module’s path, which is also the import path used while importing packages that are part of this module. 'go get -u=patch' update all the dependencies of that package. I used go get -u github.com/dave/wasmgo to install a package for the first time yesterday. Stack Overflow for Teams is a private, secure spot for you and Imagine the following project structure outside the they're used to log you in. To learn more, see our tips on writing great answers. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Even then, you will probably still need to be inside a module if the thing you are getting is not a main binary: otherwise, the result is somewhat nonsensical. Maybe it would make more sense to have an error that states explicitly how to, for example, update all of the module's dependencies, which is likely what someone running go get -u in the module root without a package is trying to do. What is the main difference between a decoder and a demultiplexer. (Special case: Lock-in amplification). Also not even sure what direction to look at - I'm pretty new to Go and I'm not really sure what documentation to look at :\ Thank you everyone! By clicking “Sign up for GitHub”, you agree to our terms of service and Asking for help, clarification, or responding to other answers. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task. Thank you @dlsniper for trying to help me on my convoluted question! So something like: Change https://golang.org/cl/234681 mentions this issue: cmd/go/internal/modget: clarify error for 'go get' without arguments. In this article, you'll learn how to organize Go code into reusable packages, how to import a package, how to export a function, type, or variable to outside packages, how to create custom packages, and how to install 3rd party packages. Permission denied message as explained above. How to explain Miller indices to someone outside nanomaterials? privacy statement. I'm having issues with go's new module system, as I'd like to define a local module and import it in the main program. Packages are used to organize related Go source files together into a single unit, making them modular, reusable, and maintainable. go get does work with modules. You mentioned working outside of GOPATH, which is one of the capabilities of the new Go modules system. Russ: https://twitter.com/_rsc/status/1034625354172981248 $ go get So, specifically if 1) . current directory, if any. What is a proper way to support/suspend cat6 cable in a drop ceiling? is no code corresponding to that import path. Can I include my published short story as a chapter to my new book? We’ll occasionally send you account related emails. Hi @carlca, I'm not an expert, but a couple quick comments. If I run the go get commands in my terminal they complete successfully, so I'm not … ;-). It lacks intellectual coherence and justification! How can I get a list of locally installed Python modules? Typically the module root will also correspond to a source code repository root (but in general it need not). they're used to log you in. I think you've seen this, but some of the options for some of those rough edges are mentioned in some of the FAQs on the modules wiki, including this shell script by rogpeppe. The author has made changes to the package, so I ran go get -u github.com/dave/wasmgo again, but I got the error go: cannot find main module; see 'go help modules'. You can always update your selection by clicking Cookie Preferences at the bottom of the page. Before Go module got introduced in Go 1.11, every project needed to be created inside the so-called GOPATH. @carlca sorry for the late reply, but given you had addressed that question to me, just wanted to briefly comment that I looked at those tweets, and I don't think Russ was giving a politician's reply. Learn more, We use analytics cookies to understand how you use our websites so we can make them better, e.g. You signed in with another tab or window. site design / logo © 2020 Stack Exchange Inc; user contributions licensed under cc by-sa. to your account, try resolves and adds dependencies by go get -v. Well, after investigation and the codebase is cmd/go/internal/modget/get.go:346 as the following: Please fill out the complete issue template: Successfully merging a pull request may close this issue. It then occurred to me that littering my machine with dummy go.mod files was probably not a good idea, so I navigated to the aforementioned ~/code/go/pkg/mod/github.com/dave/wasmgo@v0.0.0-20180816095012-16077efc512b folder and ran go mod init github.com/dave/wasmgo. Stack Overflow for Teams is a private, secure spot for you and So it sounds like part of your question then might be how do you install a command/binary via go get when running in module-aware mode? I have a weird issue that arose when I took a break from this project. bradfitz changed the title go list and rooted paths cmd/go: go list and rooted paths Feb 1, 2016. Hi, @thepudds, would you mind having a look at the series of tweets I've just had involving Russ Cox. Already on GitHub? how to highlight (with glow) any path using Tikz? List the actual commands that you ran (with any sensitive paths anonymized). If you set GO111MODULE=on, go get github.com/rivo/tview does not work. how to highlight (with glow) any path using Tikz? The local package resides in a folder of the main package/root folder. For more information, see our Privacy Statement. Playing rhythm guitar without the right index finger. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task. Successfully merging a pull request may close this issue. For example 'go get golang.org/x/perf' succeeds even though there Analytics cookies. I do not plan on pushing the module to a server and and just needed a way of referencing the local package model, so I chose example.com/localModule/ and example.com/localModule/model respectively. after removing go.mod and go.dep from each of the folders I did go mod init in, I could build without issue (through terminal). I'm having issues with go's new module system, as I'd like to define a local module and import it in the main program. Can a wild shaped druid reply to Message? The go.mod file defines the module’s module path, which is also the import path used for the root directory, and its dependency requirements, which are the other modules needed for a successful build I disabled it and GoLand was able to index the external packages and my own packages. Had I seen those a few weeks or months ago, then perhaps this whole episode might not have been so wearisome! If the @v in new@v is omitted, the new path should be a local module root directory, not a module path. ...which gets back to some of my earlier comments about the behavior is currently expected to be different depending on where you are in the filesystem when you run go get (including whether or not you are "inside" a module by being inside a filesystem tree that has a go.mod file, etc.).