is there a way to update go packages and ignore errors?

Viewed 367

Here's the scenario:

  • in package myPackage I make a breaking change. No worries, it's private, nobody cares
  • in project myProject I would like to use the new myPackage version.
  • running go get -u ./... in myProject will not update the package, since go will find errors (due to the breaking changes).

I can see how this is a good idea, but in this very case I would like go to force the update, break everything, so I can follow the compiler errors until my code is finally ready.

Is there any way to achieve this ?

1 Answers

The -d flag causes go get to download the requested packages but not build them. (The -d flag is planned to be the default behavior of go get starting with Go 1.18.)

go get -d -u ./... should perform the update you intend.

Related