Skip to content

Commit 39398ef

Browse files
committed
go fmt with Go 1.19 to address lint errors
1 parent 719674f commit 39398ef

File tree

10 files changed

+30
-31
lines changed

10 files changed

+30
-31
lines changed

internal/controller/postgrescluster/instance.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,10 +870,11 @@ func (r *Reconciler) rolloutInstances(
870870
// scaleDownInstances removes extra instances from a cluster until it matches
871871
// the spec. This function can delete the primary instance and force the
872872
// cluster to failover under two conditions:
873-
// - If the instance set that contains the primary instance is removed from
874-
// the spec
875-
// - If the instance set that contains the primary instance is updated to
876-
// have 0 replicas
873+
// - If the instance set that contains the primary instance is removed from
874+
// the spec
875+
// - If the instance set that contains the primary instance is updated to
876+
// have 0 replicas
877+
//
877878
// If either of these conditions are met then the primary instance will be
878879
// marked for deletion and deleted after all other instances
879880
func (r *Reconciler) scaleDownInstances(

internal/controller/postgrescluster/pki_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
*/
18+
1819
package postgrescluster
1920

2021
import (

internal/controller/postgrescluster/pod_disruption_budget_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
*/
18+
1819
package postgrescluster
1920

2021
import (

internal/controller/postgrescluster/util.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ func addDevSHM(template *corev1.PodTemplateSpec) {
149149
// addTMPEmptyDir adds a "tmp" EmptyDir volume to the provided Pod template, while then also adding a
150150
// volume mount at /tmp for all containers defined within the Pod template
151151
// The '/tmp' directory is currently utilized for the following:
152-
// * As the pgBackRest lock directory (this is the default lock location for pgBackRest)
153-
// * The location where the replication client certificates can be loaded with the proper
154-
// permissions set
152+
// - As the pgBackRest lock directory (this is the default lock location for pgBackRest)
153+
// - The location where the replication client certificates can be loaded with the proper
154+
// permissions set
155155
func addTMPEmptyDir(template *corev1.PodTemplateSpec) {
156156

157157
template.Spec.Volumes = append(template.Spec.Volumes, corev1.Volume{

internal/kubeapi/patch.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ func (*JSON6902) pointer(tokens ...string) string {
6161
// >
6262
// > o If the target location specifies an object member that does exist,
6363
// > that member's value is replaced.
64-
//
6564
func (patch *JSON6902) Add(path ...string) func(value interface{}) *JSON6902 {
6665
i := len(*patch)
6766
f := func(value interface{}) *JSON6902 {
@@ -83,7 +82,6 @@ func (patch *JSON6902) Add(path ...string) func(value interface{}) *JSON6902 {
8382
// > The "remove" operation removes the value at the target location.
8483
// >
8584
// > The target location MUST exist for the operation to be successful.
86-
//
8785
func (patch *JSON6902) Remove(path ...string) *JSON6902 {
8886
*patch = append(*patch, map[string]interface{}{
8987
"op": "remove",
@@ -99,7 +97,6 @@ func (patch *JSON6902) Remove(path ...string) *JSON6902 {
9997
// > with a new value.
10098
// >
10199
// > The target location MUST exist for the operation to be successful.
102-
//
103100
func (patch *JSON6902) Replace(path ...string) func(value interface{}) *JSON6902 {
104101
i := len(*patch)
105102
f := func(value interface{}) *JSON6902 {
@@ -144,7 +141,6 @@ func NewMergePatch() *Merge7386 { return &Merge7386{} }
144141
// > contain the member, the value is replaced. Null values in the merge
145142
// > patch are given special meaning to indicate the removal of existing
146143
// > values in the target.
147-
//
148144
func (patch *Merge7386) Add(path ...string) func(value interface{}) *Merge7386 {
149145
position := *patch
150146

internal/logging/logrus.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ import (
2929

3030
// Logrus creates a function that writes genericr.Entry to out using a logrus
3131
// format. The resulting logrus.Level depends on Entry.Error and Entry.Level:
32-
// - Entry.Error ≠ nil → logrus.ErrorLevel
33-
// - Entry.Level < debug → logrus.InfoLevel
34-
// - Entry.Level ≥ debug → logrus.DebugLevel
32+
// - Entry.Error ≠ nil → logrus.ErrorLevel
33+
// - Entry.Level < debug → logrus.InfoLevel
34+
// - Entry.Level ≥ debug → logrus.DebugLevel
3535
func Logrus(out io.Writer, version string, debug int) genericr.LogFunc {
3636
root := logrus.New()
3737

internal/pgbackrest/config.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ func MakePGBackrestLogDir(template *corev1.PodTemplateSpec,
168168
// RestoreCommand returns the command for performing a pgBackRest restore. In addition to calling
169169
// the pgBackRest restore command with any pgBackRest options provided, the script also does the
170170
// following:
171-
// - Removes the patroni.dynamic.json file if present. This ensures the configuration from the
172-
// cluster being restored from is not utilized when bootstrapping a new cluster, and the
173-
// configuration for the new cluster is utilized instead.
174-
// - Starts the database and allows recovery to complete. A temporary postgresql.conf file
175-
// with the minimum settings needed to safely start the database is created and utilized.
176-
// - Renames the data directory as needed to bootstrap the cluster using the restored database.
177-
// This ensures compatibility with the "existing" bootstrap method that is included in the
178-
// Patroni config when bootstrapping a cluster using an existing data directory.
171+
// - Removes the patroni.dynamic.json file if present. This ensures the configuration from the
172+
// cluster being restored from is not utilized when bootstrapping a new cluster, and the
173+
// configuration for the new cluster is utilized instead.
174+
// - Starts the database and allows recovery to complete. A temporary postgresql.conf file
175+
// with the minimum settings needed to safely start the database is created and utilized.
176+
// - Renames the data directory as needed to bootstrap the cluster using the restored database.
177+
// This ensures compatibility with the "existing" bootstrap method that is included in the
178+
// Patroni config when bootstrapping a cluster using an existing data directory.
179179
func RestoreCommand(pgdata string, args ...string) []string {
180180

181181
// After pgBackRest restores files, PostgreSQL starts in recovery to finish

internal/postgis/postgis.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import (
2424
)
2525

2626
// EnableInPostgreSQL installs triggers for the following extensions into every database:
27-
// - postgis
28-
// - postgis_topology
29-
// - fuzzystrmatch
30-
// - postgis_tiger_geocoder
27+
// - postgis
28+
// - postgis_topology
29+
// - fuzzystrmatch
30+
// - postgis_tiger_geocoder
3131
func EnableInPostgreSQL(ctx context.Context, exec postgres.Executor) error {
3232
log := logging.FromContext(ctx)
3333

internal/postgres/password/scram.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ func (s *SCRAMPassword) isASCII() bool {
162162
// using SCRAM. It differs from RFC 4013 in that it returns the original,
163163
// unmodified password when:
164164
//
165-
// - the input is not valid UTF-8
166-
// - the output would be empty
167-
// - the output would contain prohibited characters
168-
// - the output would contain ambiguous bidirectional characters
165+
// - the input is not valid UTF-8
166+
// - the output would be empty
167+
// - the output would contain prohibited characters
168+
// - the output would contain ambiguous bidirectional characters
169169
//
170170
// See:
171171
//

internal/util/features.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const (
4343
// To add a new feature, define a key for it above and add it here.
4444
// An example entry is as follows:
4545
//
46-
// FeatureName: {Default: false, PreRelease: featuregate.Alpha},
46+
// FeatureName: {Default: false, PreRelease: featuregate.Alpha},
4747
//
4848
// - https://releases.k8s.io/v1.20.0/pkg/features/kube_features.go#L729-732
4949
var pgoFeatures = map[featuregate.Feature]featuregate.FeatureSpec{

0 commit comments

Comments
 (0)