I have 2 files in the same package.
# my_package1/my_file1.go
func myFunc1() {
//....
}
# my_package1/my_file1_test.go
type MyPackageSuite struct {
suite.Suite
}
func (s *MyPackageSuite) MyTest1() {
//...............
res1 := myFunc1()
//...............
}
I run a test go test my_package1/my_file1_test.go -v
and it returns undefined: myFunc1
But they're in the same package. Why the error? How to fix it? Making the method public isn't what I'm looking for.
Update1:
$ ls webhook
doc.go webhook.go webhook_test.go
Then
$ go test webhook
can't load package: package webhook: malformed module path "webhook": missing dot in first path element
$ go test webhook/webhook
can't load package: package webhook/webhook: malformed module path "webhook/webhook": missing dot in first path element
$ go test webhook/webhook.go
? command-line-arguments [no test files]
$ go test webhook/webhook_test.go
# command-line-arguments [command-line-arguments.test]
webhook/webhook_test.go: undefined: myFunc1
FAIL command-line-arguments [build failed]
FAIL