From f6f8d5c037e4e5b7732ce4046a8eb7db81e819cb Mon Sep 17 00:00:00 2001
From: Pavel Safonov
Date: Wed, 3 May 2023 15:40:32 +0300
Subject: [PATCH] postgres: refactoring
---
format/format.go | 2 +-
format/postgres/pg_control.go | 6 +++---
format/postgres/pg_heap.go | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/format/format.go b/format/format.go
index 4ef71e68..8c0118e6 100644
--- a/format/format.go
+++ b/format/format.go
@@ -343,7 +343,7 @@ type TLS_In struct {
Keylog string `doc:"NSS Key Log content"`
}
-type PostgresIn struct {
+type PgControlIn struct {
Flavour string `doc:"PostgreSQL flavour: postgres14, pgproee14.., postgres10"`
}
diff --git a/format/postgres/pg_control.go b/format/postgres/pg_control.go
index 1f793a0b..dd5b072a 100644
--- a/format/postgres/pg_control.go
+++ b/format/postgres/pg_control.go
@@ -32,7 +32,7 @@ func init() {
interp.RegisterFormat(format.PG_CONTROL, &decode.Format{
Description: "PostgreSQL control file",
DecodeFn: decodePgControl,
- DefaultInArg: format.PostgresIn{
+ DefaultInArg: format.PgControlIn{
Flavour: "",
},
})
@@ -72,9 +72,9 @@ const (
func decodePgControl(d *decode.D) any {
d.Endian = decode.LittleEndian
- var pgIn format.PostgresIn
+ var pgIn format.PgControlIn
if !d.ArgAs(&pgIn) {
- d.Fatalf("DecodeInArg must be PostgresIn!\n")
+ d.Fatalf("DecodeInArg must be PgControlIn!\n")
}
switch pgIn.Flavour {
diff --git a/format/postgres/pg_heap.go b/format/postgres/pg_heap.go
index 5ef82744..e7d40ead 100644
--- a/format/postgres/pg_heap.go
+++ b/format/postgres/pg_heap.go
@@ -37,7 +37,7 @@ func decodePgheap(d *decode.D) any {
var pgIn format.PostgresHeapIn
if !d.ArgAs(&pgIn) {
- d.Fatalf("DecodeInArg must be PostgresIn!\n")
+ d.Fatalf("DecodeInArg must be PostgresHeapIn!\n")
}
switch pgIn.Flavour {