Skip to content
← Back to Community
Are Golang dependencies & packages supported?
Profile icon
myorama

Hi, I need some community packages in a Go project

I've seen packages are configurable through UI but only for javascript, python and ruby languages (https://repl.it/site/docs/repls/packages)

Is there any news about Universal Package Manager, as announced 5 month ago? https://repl.it/talk/announcements/Announcing-Universal-Package-Manager/5201

Will be pretty cool to manage Golan packages too! :D

Voters
Profile icon
myorama
Profile icon
donvito
Profile icon
tranzfat
Profile icon
jonnybeadle
Profile icon
tim15
Profile icon
coalesce
Profile icon
EricDunaway
Profile icon
heyimnox
Profile icon
HussainKader
Comments
hotnewtop
Profile icon
tim15

Any updates?

Profile icon
jeremejazz

@tim15 You can use go modules. Running will automatically create a go.mod file

Profile icon
jeremejazz

Hi I have just bumped into this. I tried running a code that requires an external package and it worked. As of 1.11 Go supports modules.
Currently no package manager on the UI unlike python or javascript but if you run the script with an import statment requiring an external package, go will automatically download the package and generate go.mod at the same time.
Here is the example script I have tried to run that uses goquery https://repl.it/@jeremejazz/Golang-1

Profile icon
myorama

@jeremejazz great !

Profile icon
tranzfat

Was going to ask this same question, updates? I'm guessing no...

Profile icon
jeremejazz

@tranzfat yes you can use external packages in go repl

Profile icon
TedH1

Go supportes packages when you import them instead of the lazy way
import (
"main/api"
)

You would instead do
import (
api "main/api"
)

To future people reading this, if you're getting a GOROOT error, this is a solution. You have to name your packages when you import them.

Profile icon
mccolljr

I'm a little disappointed at the lack of response by the repl.it team about this.

Profile icon
jeremejazz

@mccolljr You can actually use community packages via Go modules. Try running a script that uses an external module ("github.com/..."