mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-06 06:15:22 +02:00
Fix the golint, gosimple warnings
This commit is contained in:
@@ -33,7 +33,7 @@ type PostgresqlParam struct {
|
||||
}
|
||||
|
||||
type ResourceDescription struct {
|
||||
Cpu string `json:"cpu"`
|
||||
CPU string `json:"cpu"`
|
||||
Memory string `json:"memory"`
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ type PostgresSpec struct {
|
||||
Patroni `json:"patroni,omitempty"`
|
||||
Resources `json:"resources,omitempty"`
|
||||
|
||||
TeamId string `json:"teamId"`
|
||||
TeamID string `json:"teamId"`
|
||||
AllowedSourceRanges []string `json:"allowedSourceRanges"`
|
||||
NumberOfInstances int32 `json:"numberOfInstances"`
|
||||
Users map[string]UserFlags `json:"users"`
|
||||
@@ -162,7 +162,7 @@ func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
|
||||
if got.EndTime.Before(got.StartTime) {
|
||||
return fmt.Errorf("'From' time must be prior to the 'To' time.")
|
||||
return fmt.Errorf("'From' time must be prior to the 'To' time")
|
||||
}
|
||||
|
||||
if !weekdayProvidedFrom || !weekdayProvidedTo {
|
||||
@@ -228,7 +228,7 @@ func (p *Postgresql) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
tmp2 := Postgresql(tmp)
|
||||
|
||||
clusterName, err := clusterName(tmp2.Metadata.Name, tmp2.Spec.TeamId)
|
||||
clusterName, err := clusterName(tmp2.Metadata.Name, tmp2.Spec.TeamID)
|
||||
if err == nil {
|
||||
tmp2.Spec.ClusterName = clusterName
|
||||
} else {
|
||||
|
||||
+5
-5
@@ -60,16 +60,16 @@ type UserSyncer interface {
|
||||
ExecuteSyncRequests(req []PgSyncUserRequest, db *sql.DB) error
|
||||
}
|
||||
|
||||
func (p NamespacedName) String() string {
|
||||
if p.Namespace == "" && p.Name == "" {
|
||||
func (n NamespacedName) String() string {
|
||||
if n.Namespace == "" && n.Name == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
return types.NamespacedName(p).String()
|
||||
return types.NamespacedName(n).String()
|
||||
}
|
||||
|
||||
func (p NamespacedName) MarshalJSON() ([]byte, error) {
|
||||
return []byte("\"" + p.String() + "\""), nil
|
||||
func (n NamespacedName) MarshalJSON() ([]byte, error) {
|
||||
return []byte("\"" + n.String() + "\""), nil
|
||||
}
|
||||
|
||||
func (n *NamespacedName) Decode(value string) error {
|
||||
|
||||
Reference in New Issue
Block a user