sourcegraph/internal/codeintel/dependencies/live/init.go
Keegan Carruthers-Smith 27569d1fc7
all: run gofmt -s -w from 1.19 (#41629)
gofmt in go1.19 does a lot of reformating of godoc strings, mostly to
make them more consistent around lists.

Test Plan: CI
2022-09-13 07:44:06 +00:00

24 lines
1.1 KiB
Go

// This package contains the version of the dependencies service initialization that should
// be used in all non-test uses. We need to have a separate package here because gitserver
// requires the dependencies service (abstractly), but our gitService dependency requires
// the internal/vcs/git. This breaks that circular dependency.
package live
import (
"github.com/sourcegraph/sourcegraph/internal/codeintel/dependencies"
"github.com/sourcegraph/sourcegraph/internal/database"
)
// GetService creates or returns an already-initialized dependencies service. If the service is
// new, it will use the given database handle and syncer instance. If the given syncer is nil,
// then ErrorSyncer will be used instead.
func GetService(db database.DB) *dependencies.Service {
return dependencies.GetService(db)
}
// TestService creates a fresh dependencies service with the given database handle and syncer
// instance. If the given syncer is nil, then ErrorSyncer will be used instead.
func TestService(db database.DB) *dependencies.Service {
return dependencies.TestService(db)
}