File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
1818 "net/url"
1919 "os"
2020 "regexp"
21+ "slices"
2122 "strings"
2223
2324 "github.com/prometheus/client_golang/prometheus"
@@ -64,11 +65,11 @@ func (e *Exporter) discoverDatabaseDSNs() []string {
6465 continue
6566 }
6667 for _ , databaseName := range databaseNames {
67- if contains (e .excludeDatabases , databaseName ) {
68+ if slices . Contains (e .excludeDatabases , databaseName ) {
6869 continue
6970 }
7071
71- if len (e .includeDatabases ) != 0 && ! contains (e .includeDatabases , databaseName ) {
72+ if len (e .includeDatabases ) != 0 && ! slices . Contains (e .includeDatabases , databaseName ) {
7273 continue
7374 }
7475
Original file line number Diff line number Diff line change @@ -24,15 +24,6 @@ import (
2424 "github.com/lib/pq"
2525)
2626
27- func contains (a []string , x string ) bool {
28- for _ , n := range a {
29- if x == n {
30- return true
31- }
32- }
33- return false
34- }
35-
3627// convert a string to the corresponding ColumnUsage
3728func stringToColumnUsage (s string ) (ColumnUsage , error ) {
3829 var u ColumnUsage
You can’t perform that action at this time.
0 commit comments