GO running test file Times could not find the package by error, but the project can be started

an error was reported when running the test file, but there was no problem with project startup

after checking the directory carefully, the path is fine

E:GOPATHsrc in gopath path

api.go:6:2: unknown import path "StreamingService/api/defs": cannot find module providing package StreamingService/api/defs
api.go:7:2: unknown import path "StreamingService/api/utils": cannot find module providing package StreamingService/api/utils

Import package path

clipboard.png

Dec.09,2021

the test command is wrong. Use

if you want to run all the tests.
go test ./...
Menu