Home > Article > Backend Development > Unable to import... (No required module provides package '.../utils/...')
Okay, I’m officially stumped. I looked at these 4 similar questions/answers:
No required module provides packet muxer error
Cannot import... (no required module provides package)
Cannot import local modules in golang
vscode: Unable to import golang package
...they all basically duplicate the same answer of running go mod init <name></name>
and go mod tidy
, which I've done numerous times, same problem still exists.
I did not upload this package to a github repository, it was just stored locally on my windows computer. I have run the command:
go mod init go_backtest
go mod tidy
...I still see these everywhere:
What’s interesting is that "go_backtest/strategies"
There is no red underline under the line:
This is what the go.mod file looks like:
module go_backtest go 1.19
I'm still new to golang, so please be kind, but how can I get this thing to "compile" and run (and make those red underlines disappear!)
# The files in the ##utils directory should belong to the same package
utils. These files should have the
package utils line at the beginning.
"go_backtest/utils/datafuncs" "go_backtest/utils/ga"and
"go_backtest/utils"
The above is the detailed content of Unable to import... (No required module provides package '.../utils/...'). For more information, please follow other related articles on the PHP Chinese website!