'packages#Load returns main module does not contain package

I am trying to run packages.Load on ./test/example/svc/node-basic-http, but I am getting main module (mymodule) does not contain package mymodule/test/example/svc/node-basic-http.

Following is my config for packages:

config := &packages.Config{
        //Dir:
        Mode:  packages.LoadAllSyntax,
        Tests: true,
    }

I am quite unsure what's happening here, as I am unfamiliar with go modules and its relation to packages and was unable to find anything similar.

go


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source