2 Matching Annotations
  1. Dec 2022
    1. For now, because you haven't published the module yet, you need to adapt the example.com/hello module so it can find the example.com/greetings code on your local file system.


      现在来说,因为尚没发布模块(example.com/greeting),你须要调整 example.com/hello模块,使得它(example.com/hello)可以在本地文件系统中找到 example.com/greetings 代码。


      步骤: To do that, use the go mod edit command to edit the example.com/hello module to redirect Go tools from its module path (where the module isn't) to the local directory (where it is).

      From the command prompt in the hello directory, run the following command:

      $ go mod edit -replace example.com/greetings=../greetings


      The command specifies that example.com/greetings should be replaced with ../greetings for the purpose of locating the dependency. After you run the command, the go.mod file in the hello directory should include a replace directive:

    2. For now, because you haven't published the module yet, you need to adapt the example.com/hello module so it can find the example.com/greetings code on your local file system.