0

How can i replace a string in go.sum. I use one SDK and it contains a strange import, that import is incorrect, the path of that library was changed to another, and when i do go mod init this incorrect import writes to go.sum.

godvlpr
  • 141
  • 1
  • 3
  • 11

1 Answers1

0

You should not touch go.sum file, make sure your go.mod file is correct and go.sum is adjusted accordingly

vijay krishna
  • 263
  • 1
  • 3
  • 14
  • I'm sure that my go.mod is correct. I use library from git, and that library has incorrent import in code – godvlpr Nov 27 '19 at 13:13
  • which library is it? you can check https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive, you can use replace directive at the end of go mod to point to right path. – vijay krishna Nov 28 '19 at 08:16
  • replace directive fixes the issues locally but the problem still exists for the consumers of the modules where replace directive is used. – Ankush Chadha Dec 09 '19 at 20:39