Avatar ·

How to import and use different packages with the same name in Go?

Hello everyone! I'm new to Go and encountered a problem when importing packages. I have a project where I use two libraries: one for working with Redis (`github.com/go-redis/redis`) and another for working with REST API (`github.com/go-resty/resty`). Both export structures and functions under the names `redis` and `resty` respectively, but that's not the problem. The problem arose when I tried to use two different packages that have the same name, for example, `crypto/md5` and a third-party package `github.com/user/md5`. I wrote this code: ```go package main import ( "crypto/md5" "github.com/user/md5" ) func main() { h := md5.New() // ... } ``` The compiler gives an error: `md5 redeclared as imported package name`. I understand that Go does not allow importing two