divideprojects / Alita_Robot

Using a deprecated function, variable, constant or field GO-W1009
Anti-pattern
Major
a month ago10 months old
mongoClient.Connect is deprecated: Use [mongo.Connect] instead.
 72	ctx, cancel := context.WithTimeout(bgCtx, 10*time.Second)
 73	defer cancel()
 74
 75	err = mongoClient.Connect(ctx) 76	if err != nil {
 77		log.Errorf("[Database][Connect]: %v", err)
 78	}
mongo.NewClient is deprecated: Use [Connect] instead.
 62
 63// dbInstance func
 64func init() {
 65	mongoClient, err := mongo.NewClient( 66		options.Client().ApplyURI(config.DatabaseURI),
 67	)
 68	if err != nil {