diff --git a/audit/hashstructure.go b/audit/hashstructure.go index da6f2fe4fa99..e8f235709ea2 100644 --- a/audit/hashstructure.go +++ b/audit/hashstructure.go @@ -220,7 +220,7 @@ type hashWalker struct { // we can quickly compare in hashWalker.Struct. We create an empty/invalid // time.Time{} so we don't need to incur any additional startup cost vs. // Now() or Unix(). -var hashTimeType = reflect.TypeOf(time.Time{}) +var hashTimeType = reflect.TypeFor[time.Time]() func (w *hashWalker) Enter(loc reflectwalk.Location) error { w.loc = append(w.loc, loc) diff --git a/sdk/database/helper/connutil/sql.go b/sdk/database/helper/connutil/sql.go index 131b3b7fd877..ac99baa81a3d 100644 --- a/sdk/database/helper/connutil/sql.go +++ b/sdk/database/helper/connutil/sql.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/vault/sdk/helper/pluginutil" "github.com/jackc/pgx/v4" "github.com/jackc/pgx/v4/stdlib" + "github.com/jackc/pgx/v5" "github.com/mitchellh/mapstructure" ) @@ -83,8 +84,7 @@ type SQLConnectionProducer struct { // This provides the field names for SQLConnectionProducer for field validation in the framework handler. func SQLConnectionProducerFieldNames() map[string]any { - scp := &SQLConnectionProducer{} - rType := reflect.TypeOf(scp).Elem() + rType := reflect.TypeFor[SQLConnectionProducer]() fieldNames := make(map[string]any, rType.NumField()) for i := range rType.NumField() {