kvdb/postgres: remove old +build directive and cleanup

Due to the update of the kvdb package to go1.18, the `// +build`
directives are no longer required. They are removed in this commit in
order to simplify upcoming commits. Along the way, a few typos are fixed
and an unused struct is removed.
This commit is contained in:
Elle Mouton 2023-01-17 13:16:58 +02:00
parent c6abf585ee
commit 3dfaa88bb4
No known key found for this signature in database
GPG key ID: D7D916376026F177
8 changed files with 2 additions and 16 deletions

View file

@ -1,5 +1,4 @@
//go:build kvdb_postgres //go:build kvdb_postgres
// +build kvdb_postgres
package postgres package postgres
@ -21,13 +20,7 @@ const (
kvTableName = "kv" kvTableName = "kv"
) )
// KV stores a key/value pair. // db holds a reference to the postgres connection.
type KV struct {
key string
val string
}
// db holds a reference to the postgres connection connection.
type db struct { type db struct {
// cfg is the postgres connection config. // cfg is the postgres connection config.
cfg *Config cfg *Config
@ -76,7 +69,7 @@ func Init(maxConnections int) {
} }
// newPostgresBackend returns a db object initialized with the passed backend // newPostgresBackend returns a db object initialized with the passed backend
// config. If postgres connection cannot be estabished, then returns error. // config. If postgres connection cannot be established, then returns error.
func newPostgresBackend(ctx context.Context, config *Config, prefix string) ( func newPostgresBackend(ctx context.Context, config *Config, prefix string) (
*db, error) { *db, error) {

View file

@ -1,5 +1,4 @@
//go:build kvdb_postgres //go:build kvdb_postgres
// +build kvdb_postgres
package postgres package postgres

View file

@ -1,5 +1,4 @@
//go:build kvdb_postgres //go:build kvdb_postgres
// +build kvdb_postgres
package postgres package postgres

View file

@ -1,5 +1,4 @@
//go:build kvdb_postgres //go:build kvdb_postgres
// +build kvdb_postgres
package postgres package postgres

View file

@ -1,5 +1,4 @@
//go:build !kvdb_postgres //go:build !kvdb_postgres
// +build !kvdb_postgres
package postgres package postgres

View file

@ -1,5 +1,4 @@
//go:build kvdb_postgres //go:build kvdb_postgres
// +build kvdb_postgres
package postgres package postgres

View file

@ -1,5 +1,4 @@
//go:build kvdb_postgres //go:build kvdb_postgres
// +build kvdb_postgres
package postgres package postgres

View file

@ -1,5 +1,4 @@
//go:build kvdb_postgres //go:build kvdb_postgres
// +build kvdb_postgres
package postgres package postgres