Using multiple versions of the same library

Golang Looking into dependency management in golang and I was quite surprised that it’s possible to import multiple versions of the same library. However it only works for major version that are considered as a different module. Which must be specified when creating the package E.g module multiversion go 1.15 require ( github.com/go-redis/redis/v7 v7.0.0 github.com/go-redis/redis/v8 v8.0.0 ) package main import ( redisv1 "github.com/go-redis/redis/v7" redisv2 "github.com/go-redis/redis/v8" ) func main() { redisv1.NewClient(&redisv1.Options{ Addr: "localhost:6379", Password: "", DB: 0, }) redisv2....

September 6, 2021 · 1 min · Nolan