This question already has an answer here:
The code works with go build main.go
and will run the application. However, go install
will throw an error. What gives?
Project structure:
app/
main.go
lib/
StockMarketController.go
GetStockMarketData.go
In my main.go
, the two other .go files are imported as such:
import (
Lib "../stockmarket-service/lib"
)
And called as such:
Lib.SomeFunction()
And it works!
Why does it fail with go install
? How do I fix my import of them?
I'm using IntelliJ IDEA and building it in there with go build
, the directory is ~./IdeaProjects/app
, could this be the issue?
</div>