Ask coding questions

← Back to all posts
How to import local packages in go?
alexalikiotis (5)

Is there any way i can import some local packages into my main.go file ??


I want to import the package 'pkg' to main.go

Answered by Vandesm14 (2736) [earned 5 cycles]
View Answer
Vandesm14 (2736)

I don't think supports packages in Go. If you'd like to have this feature, try posting it to

If I answered your question:

alexalikiotis (5)

@Vandesm14 Ohh bummer! Thanks for the answer.

GrahamWalters (5)

This took me a while to figure out, but it is supported as of 2020. Your main would look something like this:

package main

import (

func main() {