What happens to a Golang project when a dependecy package's owner removes the repository from github?

Viewed 303

I'm new to Golang, I come from NodeJS and I'm a little concerned about how the dependency management works.

In Node you can rest assured that an NPM dependency will never cease to be available since it's hosted on NPM.com, and they don't allow owners to remove them. However, in Github an owner could pretty much remove the entire repo and leave every project in the world that depends on it, unusable.

I'd like to know how does this work. Is there a mirror on Golang's side that keeps the packages safe? Or is there a way to achieve something similar to Node's approach wiwhout having to host the packages inside your project?

1 Answers

What happens to a Golang project when a dependecy package's owner removes the repository from github?

Nothing dramatic.

  • If you are not using a Module Proxy and package moved to a different hosting site: Replace the import paths
  • If you are not using a Module Proxy, package is moved to a different hosting site and package/module used vanity import path that are kept constant: No action required.
  • If you use a Module Proxy: No action required.

Most likely you use the default proxy already. The problem is far less problematic than anything in the npm world.

Related