mardi 13 février 2018

Golang testing, same package, undefined func

I am pretty new to go, and trying to write up a test file for go. When I run the test, I have two questions: 1. I have to run "go test -cover , then I can see this: enter image description here

My question is why I can't just run: go test (If I do this, I see this:

  1. My second question is there are two files in the package(one package in a big project), a file1, and a test.go file for that file1. Why I can't access the func in file1 in test.go (undefined). I am sure the test file is in correct format and the function is exported. I have been checking online for solutions for days. Any thoughts would be helpful. I am sorry that I can't show the code and I really appreciate your help.

Thank you

Aucun commentaire:

Enregistrer un commentaire