Skip to content
Prev Previous commit
Next Next commit
format issues
  • Loading branch information
Georgi Dimitrov committed Dec 8, 2025
commit cde16643b3fe984598cd6beec965e14e4389fd1b
6 changes: 2 additions & 4 deletions retriever/postgresqlretriever/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
}

var (
mu sync.Mutex
poolMap = make(map[string]*poolEntry)
mu sync.Mutex
poolMap = make(map[string]*poolEntry)
)

// GetPool returns a pool for a given URI, creating it if needed.
func GetPool(ctx context.Context, uri string) (*pgxpool.Pool, error) {

Check warning on line 21 in retriever/postgresqlretriever/postgres.go

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the 'Get' prefix from this function name.

See more on https://sonarcloud.io/project/issues?id=thomaspoignant_go-feature-flag&issues=AZr-EwCDEH6-E3iE4Su9&open=AZr-EwCDEH6-E3iE4Su9&pullRequest=4393
mu.Lock()
defer mu.Unlock()

Expand Down Expand Up @@ -46,7 +46,6 @@
return pool, nil
}


// ReleasePool decreases refCount and closes/removes when it hits zero.
func ReleasePool(uri string) {
mu.Lock()
Expand All @@ -63,4 +62,3 @@
delete(poolMap, uri)
}
}

1 change: 0 additions & 1 deletion retriever/postgresqlretriever/retriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
}

// Shutdown closes the database connection.
func (r *Retriever) Shutdown(ctx context.Context) error {

Check warning on line 70 in retriever/postgresqlretriever/retriever.go

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Unused parameter 'ctx' should be removed.

See more on https://sonarcloud.io/project/issues?id=thomaspoignant_go-feature-flag&issues=AZrf8MI6sn8GrSqJf98Q&open=AZrf8MI6sn8GrSqJf98Q&pullRequest=4393
if r.pool != nil {
ReleasePool(r.URI)
r.pool = nil
Expand All @@ -75,7 +75,6 @@
return nil
}


// Retrieve fetches flag configuration from PostgreSQL.
func (r *Retriever) Retrieve(ctx context.Context) ([]byte, error) {
if r.pool == nil {
Expand Down
Loading