Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij cannot load file .go same package

I have the problem running file main.go in Intellij.

My structure project

Main.go and Common.go same package main. I run Main.go in Intellij then consle log display message error: ".\Main.go:9: undefined: showMsg". showMsg is a function of Common.go

like image 887
Cuong Huy Avatar asked Dec 15 '25 04:12

Cuong Huy


1 Answers

This video should show you how to solve the problem. You basically need to use a Run Configuration of type Go Application and use a Package kind not File kind.

like image 153
dlsniper Avatar answered Dec 16 '25 21:12

dlsniper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!