Local Import Issue in Non-Local Package
When attempting to install a package (jacob.uk.com) from outside its directory (src/jacob.uk.com) using go install, a developer encountered the error "local import ./greeting in non-local package." This error occurs because local imports (i.e., relative imports within a package) are not allowed when specifying a non-local package for installation.
Solution:
To resolve this issue, the developer has two options:
The above is the detailed content of Why Does `go install` Fail with 'local import in non-local package' and How Can I Fix It?. For more information, please follow other related articles on the PHP Chinese website!