Can't run golang program

On IntelliJ IU-191.6183.87 I try to run a golang program but I get the error :

$GOPATH/go.mod exists but should not

I searched on google and here for a solution and didn't find one.

The IDE log:

 

2019-04-02 09:16:10,353 [87514801]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 12ms; general responsiveness: ok; EDT responsiveness: ok 
2019-04-02 09:17:32,932 [87597380] WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: language for id: preferences.language.Kotlin.scripting
2019-04-02 09:17:53,907 [87618355] INFO - rationStore.ComponentStoreImpl - Saving Project '/Users/alexpavy/PolyAI/please' pleaseRunManager took 16 ms
2019-04-02 09:17:53,913 [87618361] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 170 ms
2019-04-02 09:21:24,429 [87828877] WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: language for id: preferences.language.Kotlin.scripting
2019-04-02 09:22:40,605 [87905053] INFO - pl.ProjectRootManagerComponent - project roots have changed
2019-04-02 09:22:40,641 [87905089] INFO - .diagnostic.PerformanceWatcher - Pushing Go no limit property to 0 roots took 1ms; general responsiveness: ok; EDT responsiveness: ok
2019-04-02 09:22:40,697 [87905145] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 24ms; general responsiveness: ok; EDT responsiveness: ok
2019-04-02 09:22:40,708 [87905156] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 11ms; general responsiveness: ok; EDT responsiveness: ok
2019-04-02 09:22:42,494 [87906942] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 67 ms
2019-04-02 09:22:42,628 [87907076] INFO - pl.ProjectRootManagerComponent - project roots have changed
2019-04-02 09:22:42,674 [87907122] INFO - .diagnostic.PerformanceWatcher - Pushing Go no limit property to 0 roots took 1ms; general responsiveness: ok; EDT responsiveness: ok
2019-04-02 09:22:42,750 [87907198] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 24ms; general responsiveness: ok; EDT responsiveness: ok
2019-04-02 09:22:42,760 [87907208] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 8ms; general responsiveness: ok; EDT responsiveness: ok
2019-04-02 09:22:42,765 [87907213] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 116 ms
2019-04-02 09:23:08,270 [87932718] ERROR - jediterm.terminal.TerminalMode - Mode EightBitInput is not implemented, setting to true
2019-04-02 09:23:08,271 [87932719] ERROR - jediterm.terminal.TerminalMode - Mode EightBitInput is not implemented, setting to true
2019-04-02 09:23:18,373 [87942821] WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: language for id: preferences.language.Kotlin.scripting
2019-04-02 09:23:18,607 [87943055] INFO - j.ide.plugins.RepositoryHelper - using cached plugin list (updated at 2019-04-02 09:21)
2019-04-02 09:25:13,341 [88057789] INFO - pl.ProjectRootManagerComponent - project roots have changed
2019-04-02 09:25:13,346 [88057794] INFO - pl.ProjectRootManagerComponent - project roots have changed
2019-04-02 09:25:13,358 [88057806] INFO - .diagnostic.PerformanceWatcher - Pushing Go no limit property to 0 roots took 0ms; general responsiveness: ok; EDT responsiveness: ok
2019-04-02 09:25:13,442 [88057890] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 21ms; general responsiveness: ok; EDT responsiveness: ok
2019-04-02 09:25:13,451 [88057899] INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 9ms; general responsiveness: ok; EDT responsiveness: ok
2019-04-02 09:25:15,369 [88059817] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 79 ms
2019-04-02 09:25:15,616 [88060064] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 84 ms
2019-04-02 09:25:27,081 [88071529] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 102 ms
2019-04-02 09:27:49,275 [88213723] WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: language for id: preferences.language.Kotlin.scripting
2019-04-02 09:28:09,694 [88234142] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 60 ms
2019-04-02 09:28:16,860 [88241308] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 73 ms
2019-04-02 09:33:26,785 [88551233] WARN - gin.utils.ProfilingUtilAdapter - YourKit controller initialization failed : To profile application, you should run it with the profiler agent
2019-04-02 09:34:50,000 [88634448] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 56 ms
2019-04-02 09:37:02,693 [88767141] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 56 ms
2019-04-02 09:38:35,368 [88859816] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 54 ms
2019-04-02 09:38:59,176 [88883624] INFO - j.ide.plugins.RepositoryHelper - using cached plugin list (updated at 2019-04-02 09:27)
2019-04-02 09:38:59,266 [88883714] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/sys-img/android/sys-img2-1.xml
2019-04-02 09:38:59,266 [88883714] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/sys-img/android-wear/sys-img2-1.xml
2019-04-02 09:38:59,266 [88883714] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/repository2-1.xml
2019-04-02 09:38:59,267 [88883715] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/sys-img/android-tv/sys-img2-1.xml
2019-04-02 09:38:59,268 [88883716] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/sys-img/google_apis/sys-img2-1.xml
2019-04-02 09:38:59,269 [88883717] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/sys-img/android-wear-cn/sys-img2-1.xml
2019-04-02 09:38:59,269 [88883717] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/sys-img/google_apis_playstore/sys-img2-1.xml
2019-04-02 09:38:59,269 [88883717] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/addon2-1.xml
2019-04-02 09:38:59,270 [88883718] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/glass/addon2-1.xml
2019-04-02 09:38:59,270 [88883718] INFO - s.RepoProgressIndicatorAdapter - Downloading https://dl.google.com/android/repository/extras/intel/addon2-1.xml
2019-04-02 09:40:55,402 [88999850] INFO - rationStore.ComponentStoreImpl - Saving Project '/Users/alexpavy/PolyAI/please' pleaseRunManager took 24 ms
2019-04-02 09:40:55,407 [88999855] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 107 ms

 

2 comments
Comment actions Permalink

Hi. It looks like a configuration issue where the GOPATH Is set to the project directory perhaps?

I recommend using the GOPATH as you previously did, for example under $HOME/go and create your project outside of it. Also, please remove the $GOPATH/src/go.mod if it exists (as this is a requirement from Go, as seen in the error from the compiler).

Please let me know if you need more details on how this works (I will need more information about your setup such as paths and so on) to be able to more accurately help you.

0
Comment actions Permalink

Hi Florin, thanks yes sorry I actually fixed it by removing the project from $GOPATH

0

Please sign in to leave a comment.