Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module name alias in go.mod

Tags:

go

go-modules

Is there a way to use a shorter name representation/mapping in modules?

I have a project, with an url naming:

module github.com/<org>/<project>    
go 1.14

Would be nice to be able to do:

import "<short_name>/<project>/package_folder"

From a go.mod, something like:

module github.com/<org>/<project> => short_name
go 1.14
like image 589
Chris G. Avatar asked Apr 21 '26 09:04

Chris G.


1 Answers

Nope, there is no way to define an alias in the go.mod file.

It was proposed but rejected for reasons explained here.

like image 192
ifnotak Avatar answered Apr 24 '26 05:04

ifnotak



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!