Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
Let's say that I want to figure out how many programmers import https://github.com/golang-migrate/migrate, similar to how I can figure it out for npm package on this website.
I know that you can guess the popularity of a package from the number of github stars, commmits etc, but I think installs count gives the most accurate picture of how popular a package is. Go package loading method is different from npm, so I wonder if it's even possible to get such intel?
Thanks in advance for your time!
Given the go tool doesn't collect/send this metric, no.
There is a different metric tracked on pkg.go.dev that shows how many other packages import the package in question.
When you open a package page (e.g. migrate) on the same line next to the version, license there is also Imported By with number. You can see detailed list of importers (only those known to pkg.go.dev site) on page it links to.
While this is not same thing npm does it can give you a rough idea of package popularity.
https://godoc.org/ shows the number of package imports right under the package name on searching for the package.
For e.g., when you search for the fmt package, it shows it has been imported 827695 times as of 23 January, 2021. This is close to the functionality of the npm site that you have referenced.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 18 days ago.
Improve this question
i have enabled the go modules integration according to this docs .
https://www.jetbrains.com/help/go/create-a-project-with-go-modules-integration.html#enable-go-modules-in-a-project
but yet again as you can see in image below . goland keep throwing error on some code i have
as you can see in image i have that execlise package but it keep giving error . not only that i have some error on other files
That happens sometimes with IDEs, from my experience it may happen because of at least three reasons.
first: the differences between package versions in your go.sum, you should empty the go.sum and run go mod tidy command.
Second: the version you’re using is older or newer than what you’re expecting, so the package does not support these methods or didn’t include them. so you should set the exact version of the package. (I suggest you read the documentation of the package in this case)
Third: your IDE has got some problems with the caches. for solving this: you should click on file -> invalidate caches to rebuild your IDE caches.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
For example, I have a project with following structure:
hello
- packageA
- subDirA
- Afile1.go
- Afile2.go
- packageB
- Bfile.go
- Bfile2.go
- packageC
- main.go
- subdirC
- xx.json
- packageD
-xx.go
How can I build them and get an executable file xxx on Linux platform, so that I can directly call them by ./xxxx?
Short answer: go build
You can run go help build to learn more on how to use it. For example, it's possible that you'll want to provide a specific path to go build, or build with ./.... It depends on the exact layout of your project.
I strongly recommend you to read some official Go documentation pages first:
Getting started with Go
How to write Go code
Work through the examples in these pages (and the other pages they lead to); this will answer most of your questions. The second link, in particular, talks about properly using go build and go install to build your projects.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
I'm developing a golang project and a shared module simultaneously.
I feel the process is annoying If shared module is modified.
steps:
write something in shared module and give it a new GIT tag.
get latest module version in my project
test, if any bug is found, back to step (1)
Can anyone give a more efficient way?
While you're developing, I'd recommend just using replace directives in your go.mod to make any changes in dependencies instantly visible (regardless of version) to client code.
E.g. if you have package "client" using package "auth":
$SOMEDIR/client/go.mod would replace dependency on client with $SOMEDIR/auth, and now you can just develop the two alongside each other in $SOMEDIR, commit changes to source control, etc.
When you're ready to "ship" it, you'll have to create an actual version for these modules. That is, if you even want auth to be separately usable from client. Consider keeping everything as private as possible (using internal).
Read this official documentation on the subject for more details
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I'm currently learning golang, I'm using windows
I've installed VSCode's Go extension.
When I hover over new package added by goimports in VSCode, I get the error
could not import io/ioutil (cannot find package "io/ioutil" in any of
C:\Users\<username>\go\src\io\ioutil (from $GOROOT)
C\src\io\ioutil (from $GOPATH)
\Users\<username>\go\src\io\ioutil (from $GOPATH))compiler
I have installed go in C:\Users\<username>\go. When I check the directory C:\Users\<username>\go\src\io\ioutil it exists(the ioutil.go file is present as well).
It's a package in go's standard library, yet it is not detected by the extension. I have to reload VSCode for it to work. Also when I compile the code using go build or go run command, the code compiles.
You should install Go somewhere else than C:\Users\<username>\go as that is also default GOPATH. Having GOPATH (a directory where your user modules are installed) in same place as GOROOT (a directory where Go itself is installed) will cause a lot of different problems and confuse many tools.
Either completely remove current installation and re-install Go somewhere else (recommended) or point your GOPATH somewhere else.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am trying to package an application I have been working on using OSX. I have the package created and I can do some basic (check system values etc) checks.
What I now want to do is to gather end user data during the install so I can create a custom config file.
I understand I must use installer plugins to do this but I cannot find any useful information to do this.
Can people please share resources, link or useful tips to help me do this.
(Super) late answer, but am currently doing this. I'm using packages. Its a program which will build an installer for you.
What you do is supply it your.app and an installer plugin, and off you go. (You can create installer plugins in Xcode when it asks you what type of project you want to work on).
Regarding problem you are solving specifically, my solution was to get the input configs from the user from the plugin I wrote. The plugin would then write these configs to a file in a temp location. I then modified my app to look for these configs and read them from there.
Note: your plugin will not run with admin privileges (even if you ticked the box in the for this in the packages app). If you need to have admin privileges, consider adding a post-install script in packages (and make sure you enable "Require admin password for installation" in the "settings" tab)