Go build: “Cannot find package” (even though GOPATH is set)

It does not work because your foobar.go source file is not in a directory called foobar. go build and go install try to match directories, not source files. Set $GOPATH to a valid directory, e.g. export GOPATH=”$HOME/go” Move foobar.go to $GOPATH/src/foobar/foobar.go and building should work just fine. Additional recommended steps: Add $GOPATH/bin to your $PATH by: PATH=”$GOPATH/bin:$PATH” Move main.go to a subfolder of $GOPATH/src, e.g. $GOPATH/src/test go install test should now create an executable in $GOPATH/bin that can be called by … Read more

How can I remove a package from Laravel using PHP Composer?

Composer 1.x and 2.x Running the following command will remove the package from vendor (or wherever you install packages), composer.json and composer.lock. Change vendor/package appropriately. Obviously you’ll need to remove references to that package within your app. I’m currently running the following version of Composer: Documentation Updates 26/10/2020 – Updated answer to assert command works … Read more

What is the difference between require() and library()?

In addition to the good advice already given, I would add this: It is probably best to avoid using require() unless you actually will be using the value it returns e.g in some error checking loop such as given by thierry. In most other cases it is better to use library(), because this will give an error message at … Read more

How to make rpm auto install dependencies

Create a (local) repository and use yum to have it resolve the dependencies for you. The CentOS wiki has a nice page providing a how-to on this. CentOS wiki HowTos/CreateLocalRepos. Summarized and further minimized (not ideal, but quickest): Create a directory for you local repository, e.g. /home/user/repo. Move the RPMs into that directory. Fix some … Read more

How to unload a package without restarting R

Try this (see ?detach for more details): It is possible to have multiple versions of a package loaded at once (for example, if you have a development version and a stable version in different libraries). To guarantee that all copies are detached, use this function. Usage is, for example or